# HG changeset patch
# User nikita@nikita-rack
# Date 1240493844 -7200
# Node ID 472d56ba57c6066d2f75866adfedf77f6a0ad750
# Parent 89bbb1c560adfd40f4ce22383913343a60a7728a
debut de la subscription
diff -r 89bbb1c560ad -r 472d56ba57c6 AndroidManifest.xml
--- a/AndroidManifest.xml Thu Apr 23 12:54:56 2009 +0200
+++ b/AndroidManifest.xml Thu Apr 23 15:37:24 2009 +0200
@@ -15,6 +15,7 @@
+
diff -r 89bbb1c560ad -r 472d56ba57c6 res/layout/subscription.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/res/layout/subscription.xml Thu Apr 23 15:37:24 2009 +0200
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 89bbb1c560ad -r 472d56ba57c6 res/values/strings.xml
--- a/res/values/strings.xml Thu Apr 23 12:54:56 2009 +0200
+++ b/res/values/strings.xml Thu Apr 23 15:37:24 2009 +0200
@@ -3,6 +3,8 @@
Beem
Ok
Clear
+ Accept
+ Refuse
@@ -59,4 +61,5 @@
Updating status
Nothing to change
+
diff -r 89bbb1c560ad -r 472d56ba57c6 src/com/beem/project/beem/BeemService.java
--- a/src/com/beem/project/beem/BeemService.java Thu Apr 23 12:54:56 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java Thu Apr 23 15:37:24 2009 +0200
@@ -14,6 +14,7 @@
import org.jivesoftware.smack.proxy.ProxyInfo.ProxyType;
import android.app.Notification;
import android.app.NotificationManager;
+import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -26,6 +27,8 @@
import com.beem.project.beem.service.aidl.IBeemConnectionListener;
import com.beem.project.beem.service.aidl.IXmppConnection;
import com.beem.project.beem.service.aidl.IXmppFacade;
+import com.beem.project.beem.ui.SendIM;
+import com.beem.project.beem.ui.Subscription;
/**
* This class is for the Beem service.
@@ -72,7 +75,7 @@
*/
@Override
public void onCreate() {
-
+
super.onCreate();
mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE);
mLogin = mSettings.getString(getString(R.string.PreferenceLoginKey), "");
@@ -117,7 +120,7 @@
public void sendNotification(int id, Notification notif) {
mNotificationManager.notify(id, notif);
}
-
+
/**
* Initialise la configuration de la connexion.
*/
@@ -168,7 +171,7 @@
@Override
public void processPacket(Packet packet) {
// TODO Auto-generated method stub
- Log.i("TEST", "Une demande recue");
+ Log.d("TEST", "Une demande recue");
}
}, filter);
}
@@ -185,7 +188,7 @@
}
-
+
@Override
public void onConnect() throws RemoteException {
// TODO Auto-generated method stub
@@ -205,8 +208,17 @@
@Override
public void processPacket(Packet packet) {
- // TODO Auto-generated method stub
- Log.i("TEST", "Une demande recue");
+ String from = packet.getFrom();
+ Notification notif = new Notification(com.beem.project.beem.R.drawable.signal, "Demande d'ajout", System
+ .currentTimeMillis());
+ notif.defaults = Notification.DEFAULT_ALL;
+ notif.flags = Notification.FLAG_AUTO_CANCEL;
+ Intent intent = new Intent(BeemService.this, Subscription.class);
+ intent.putExtra("from", from);
+ notif.setLatestEventInfo(BeemService.this, from, "demande d'ajout de " + from, PendingIntent.getActivity(BeemService.this, 0,
+ intent, PendingIntent.FLAG_ONE_SHOT));
+ int id = packet.hashCode();
+ sendNotification(id, notif);
}
}, filter);
@@ -228,7 +240,7 @@
@Override
public void connectionFailed(String errorMsg) throws RemoteException {
// TODO Auto-generated method stub
-
+
}
});
} catch (RemoteException e) {
@@ -245,5 +257,5 @@
mConnection.disconnect();
}
-
+
}
diff -r 89bbb1c560ad -r 472d56ba57c6 src/com/beem/project/beem/service/BeemChatManager.java
--- a/src/com/beem/project/beem/service/BeemChatManager.java Thu Apr 23 12:54:56 2009 +0200
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Thu Apr 23 15:37:24 2009 +0200
@@ -15,7 +15,6 @@
import org.jivesoftware.smackx.ChatState;
import org.jivesoftware.smackx.ChatStateListener;
-import android.R;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
diff -r 89bbb1c560ad -r 472d56ba57c6 src/com/beem/project/beem/ui/Subscription.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/beem/project/beem/ui/Subscription.java Thu Apr 23 15:37:24 2009 +0200
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package com.beem.project.beem.ui;
+
+import com.beem.project.beem.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.Button;
+
+/**
+ * @author nikita
+ *
+ */
+public class Subscription extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.subscription);
+ //mOk = (Button) findViewById(R.id.SubscriptionAccept);
+ }
+}