Rajout de Log dans le beem service pour les reconnections etc.
Ajout d'un TODO dans le SendIM
Mise en place d'un tri de la liste de contact
--- a/src/com/beem/project/beem/BeemService.java Wed Jun 17 20:21:14 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java Thu Jun 18 11:30:23 2009 +0200
@@ -10,6 +10,7 @@
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.proxy.ProxyInfo.ProxyType;
+
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -108,19 +109,19 @@
@Override
public void connectionClosed() throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "connectionClosed()");
}
@Override
public void connectionClosedOnError() throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "connectionClosedOnError()");
}
@Override
public void connectionFailed(String errorMsg) throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "connectionFailed()");
}
@@ -158,24 +159,24 @@
sendNotification(id, notif);
}
}, filter);
-
+ Log.i("BeemService", "onConnect()");
}
@Override
public void reconnectingIn(int seconds) throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "reconnectingIn()");
}
@Override
public void reconnectionFailed() throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "reconnectionFailed()");
}
@Override
public void reconnectionSuccessful() throws RemoteException {
- // TODO Auto-generated method stub
+ Log.i("BeemService", "reconnectionSuccessful()");
PacketFilter filter = new PacketFilter() {
@Override
--- a/src/com/beem/project/beem/ui/ContactList.java Wed Jun 17 20:21:14 2009 +0200
+++ b/src/com/beem/project/beem/ui/ContactList.java Thu Jun 18 11:30:23 2009 +0200
@@ -1,9 +1,13 @@
package com.beem.project.beem.ui;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.SortedMap;
import org.jivesoftware.smack.util.StringUtils;
@@ -26,6 +30,7 @@
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
+import android.widget.ArrayAdapter;
import android.widget.ExpandableListAdapter;
import android.widget.ImageView;
import android.widget.TextView;
@@ -99,7 +104,18 @@
unbindService(mServConn);
}
+ class ComparatorContactListByStatus<T> implements Comparator<T> {
+ @Override
+ public int compare(T c1, T c2) {
+ if (((Contact) c1).getStatus() < ((Contact) c2).getStatus())
+ return 1;
+ return -1;
+ }
+
+ }
+
private void buildContactList(List<Contact> listContact) {
+ Collections.sort(listContact, new ComparatorContactListByStatus<Contact>());
mListContact = listContact;
for (Contact contact : listContact) {
for (String group : contact.getGroups()) {
@@ -447,8 +463,10 @@
xmppFacade = IXmppFacade.Stub.asInterface(service);
try {
mRoster = xmppFacade.getRoster();
- mRoster.addRosterListener(new BeemRosterListener());
- buildContactList(mRoster.getContactList());
+ if (mRoster != null) {
+ mRoster.addRosterListener(new BeemRosterListener());
+ buildContactList(mRoster.getContactList());
+ }
} catch (RemoteException e) {
e.printStackTrace();
}
--- a/src/com/beem/project/beem/ui/SendIM.java Wed Jun 17 20:21:14 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java Thu Jun 18 11:30:23 2009 +0200
@@ -248,6 +248,7 @@
Message msg = new Message(mContact.getJID(), Message.MSG_TYPE_CHAT);
msg.setBody(text);
try {
+ //TODO: PAs connecter au serveur BING grosse Error ! INTERDICTION !
mChat.sendMessage(msg);
if (mSpeak != 1)
mText.append(getString(R.string.SendIMYouSay) + text + '\n');