Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting status of gtalk through android application [duplicate]

Tags:

android

Using my application, i want to change the status of my gmail or gtalk. How can i change it? Is there any sample code??

Thanks in advance.

like image 782
Arindam Mukherjee Avatar asked Nov 25 '22 19:11

Arindam Mukherjee


1 Answers

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);
like image 98
Reno Avatar answered Jan 17 '23 09:01

Reno