commit pour test avec barbu
authorDa Risk <darisk972@gmail.com>
Wed, 18 Mar 2009 21:37:12 +0100
changeset 18 1063d4bde1aa
parent 17 afd3a080d318
child 19 213b84d2e743
commit pour test avec barbu
libs/smack.jar
libs/smackx-debug.jar
libs/smackx-jingle.jar
libs/smackx.jar
src/com/beem/project/beem/BeemService.java
Binary file libs/smack.jar has changed
Binary file libs/smackx-debug.jar has changed
Binary file libs/smackx-jingle.jar has changed
Binary file libs/smackx.jar has changed
--- a/src/com/beem/project/beem/BeemService.java	Wed Mar 18 00:24:00 2009 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Wed Mar 18 21:37:12 2009 +0100
@@ -3,7 +3,12 @@
  */
 package com.beem.project.beem;
 
+import java.util.List;
+
 import org.jivesoftware.smack.XMPPConnection;
+import org.jivesoftware.smack.XMPPException;
+
+import com.beem.project.beem.service.IXMPPFacade;
 
 import android.app.Notification;
 import android.app.NotificationManager;
@@ -12,6 +17,7 @@
 import android.content.Intent;
 import android.content.res.Resources;
 import android.os.IBinder;
+import android.os.RemoteException;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -25,6 +31,15 @@
 
     private XMPPConnection connection;
     
+    private IXMPPFacade.Stub bind = new IXMPPFacade.Stub() {
+    
+        @Override
+        public List<String> getContactList() throws RemoteException {
+    	// TODO Auto-generated method stub
+    	return null;
+        }
+    };
+    
     /* (non-Javadoc)
      * @see android.app.Service#onBind(android.content.Intent)
      */
@@ -47,9 +62,19 @@
     
     public void onCreate(){
 	super.onCreate();
-//	connection = new XMPPConnection("10.0.2.2"); // address du pc host de l'emulateur
-	notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
-	showBasicNotification(R.string.BeemServiceCreated);
+	connection = new XMPPConnection("10.224.13.6"); // address du pc host de l'emulateur
+	try {
+	    connection.connect();
+	    connection.login("bart", "bart");
+	    notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+	    showBasicNotification(R.string.BeemServiceCreated);
+	} catch (XMPPException e) {
+	    // TODO Auto-generated catch block
+	    Toast toast = Toast.makeText(this, "ERREUR " + e.getMessage(), Toast.LENGTH_LONG);
+	    toast.show();
+	    e.printStackTrace();
+	}
+	
     }
     
     public void onDestroy() {