Hi
I am creating a simple app that will provide me the status(online/offline) of my friend in google chat. I use asmack API fot connecting to google. But, my application crashes the moment i click the GET STATUS button. Can u please help..? Following is the code...
I am creating a simple app that will provide me the status(online/offline) of my friend in google chat. I use asmack API fot connecting to google. But, my application crashes the moment i click the GET STATUS button. Can u please help..? Following is the code...
Code:
XMPPConnection connection = new XMPPConnection("gmail.com");
connection.connect();
connection.login(editText1.getText().toString()+"@gmail.com",editText2.getText().toString());
Roster roster = connection.getRoster();
Presence p = roster.getPresence(editText3.getText().toString());
if(p.getType()==Presence.Type.available){
textView2.setText("Available");