powered by Jive Software

Find out which resource the user''s presence was returned for?

From Smack javadoc for Roster:

public Presence getPresence(String user)


If the user has several presences (one for each

resource) then answer the presence with the

highest priority.

So the user can have multiple presences (for various resources) and only one will be returned (highest priority). Can i find out what exact resource the presence was returned for?

And also when I use conn.login(“x”, “y”) what is the resource called (if anything)? Can I change this?

Thanks and regards, Alex

Message was edited by:


Message was edited by:


You should be able to get a resource via: StringUtils.parseResource(Presence#getFrom()) You can also look in the smack debugger to see which resource you are using but if you are just using conn#login(username, password) your resource will be “Smack”. If you would like to use your own resource try, conn#login(username, password, resource) instead.

Hope that helps.


Great - thanks!