0

FB chat wrkd fine 4 me. I used asmack-15-issue.jar and hostname:chat.facebook.com, port: 5222 and service name: chat.facebook.com. But the issue is with email id's. when iam extracting the friends chat list and dispalying in a listview, their email id's are being dispalyed in some unkown format ex: -1233708987@chat.facebook.com but not their exact id's. Anyone, please help me in resolving dis issue....

Thanks, Hareen

Hareen
  • 15
  • 1
  • 5
  • Hi Hareen I am searching for the facebook chat in android .Can u provide me the sample code – Pinki Apr 14 '11 at 05:36
  • Hi Pinki, FB chat is no where different from gtalk chat, for which u can find the source code at http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/ – Hareen Apr 19 '11 at 09:15
  • ConnectionConfiguration connConfig = 42 new ConnectionConfiguration(host, Integer.parseInt(port), service); //Here for host u give as chat.facebook.com, port = 5222 and service = chat.facebook.com. And also just add a line. SASLAuthentication.supportSASLMechanism("PLAIN", 0); Try this, if u are still unable to get it work. Let me know... Thanks, Hareen – Hareen Apr 19 '11 at 09:20
  • hi Hareen .. i am facing the problem to connect facebook chat in my application..i also mention my problem related to this in S.O. http://stackoverflow.com/questions/8532328/problems-with-connecting-to-facebook-xmmp-md5-digest this is the link ..please give me solution how i am connected with XMPP.. – Kutbi Dec 17 '11 at 06:01
  • @Hareen how you could get the online friends and chatting,i also connected using xmpp facebook chat,how to get the friends list and all – Karthick M Apr 02 '14 at 08:39

1 Answers1

0

This ll solve the problem

// Get the user's roster
Roster roster = connection.getRoster();

// Print the number of contacts
for(RosterEntry entry:roster.getEntries()){
    System.out.println(entry.getName());
}
Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
newbie
  • 80
  • 1
  • 1
  • 7