How do i get the presence info

hi i am a nwbie to smack and wildfire.

i have been following the documentation diligently. i could successfully create a connection. login, create a roster… add frnds.

i loogged in simultaeneoulsy as another user…

now i tried to get the presence from teh roster using

Presence p1 = roster.getPresence("");

but i get “p1” as null.

when i check on server the status of username is ONLINE.

where am i going wrong. could some one please help me

Hey, this is taken from the javadocs

Roster#getPresence(String jid)

“Returns the presence info for a particular user’‘s resource, or null if the user is unavailable (offline) or if no presence information is available, such as when you are not subscribed to the user’'s presence updates.”

You have probably not yet subscribed to the user’'s presence. Make sure you have and then try the method call again. It should work fine


thank u jon

yes i had not subscribed …