使用我的应用程序,我想改变我的Gmail或者Gtalk的状态。我怎样才能改变呢? 有什么样code ??
Using my application, i want to change the status of my gmail or gtalk. How can i change it? Is there any sample code??
在此先感谢。
如果您正在使用的啪API 为Android:
If you are using Smack API for Android :
// Create the presence object with default availability
Presence presence = new Presence(Presence.Type.available);
// Set the status message
presence.setStatus("Lame status is lame");
// Set the highest priority
presence.setPriority(24);
// Set available presence mode
presence.setMode(Presence.Mode.available);
// Send the presence packet through the connection
connection.sendPacket(presence);