Develop your own MSN java client.

Written by Ivan Shi


Continued from page 1

trail to
// your message
mm.setMessage("How are you doing?

");
// setrepparttar message kind to MESSAGE -_-!!!
// you have to do this.
mm.setKind(mm.KIND_MESSAGE);

if (robot.msn.sendMessage(mm,ss))
{
// message sent successfully
System.out.println("send msg ok!");
}else{
// failed
System.out.println("send msg faild!");
}
}catch(Exception e){
e.printStackTrace();
}
}
}


Coding Step 2: Write a public class withrepparttar 107680 static
main method as your own msn client.



public class Client {

public static void main(String[] args) {
Email = "your@hotmail.com";
Password = "you_msn_account_password";
// create a new MSNMessenger instance msn
msn = new MSNMessenger(Email,Password);
// setrepparttar 107681 initial status to online.
msn.setInitialStatus(UserStatus.ONLINE);
// register your pre-created adapter to msn
msn.addMsnListener(new MSNAdapter(msn));
// login intorepparttar 107682 msn network
msn.login();

System.out.println("Waiting forrepparttar 107683 response....");
}
}



Coding Step 3: Debug or run your application.Inrepparttar 107684 context menu
of project jRCS,  select Run --> Java Application, Eclipse will compilerepparttar 107685 code
and runrepparttar 107686 application in the  Console.
If you have your msn account set properly, and you have another msn account that
add this msn account as contact, you will see this msn account log in, and then you can send
some message to this contact as you wish, how everrepparttar 107687 Contact will only and always answer
you "How are you doing?".*_^


Ivan Shi, Web Server System Developer living and working in Shanghai,China He has a Blog "Technically Blog Ivan"(http://www.ivanshi.com/), blogging his life,feel,mind and technology. He is doing a lot to make his speaking and writing English much more better!


The Da Vinci Code Is A Must-Read Thriller

Written by Rakhi Garg


Continued from page 1

What is this mind threatening puzzle? Want to unfold this nail-biting mystery? Then please download on your palm a great, exhilarating, fascinating and spellbinding story--“THE DA VINCI CODE BY DAN BROWN”.

I am sure, once you start to read this, you will find yourself totally helpless to get rid of it till you will not finish it.

Rakhi Garg is a freelance writer for http://www.free-palm-programs.com The #1 source for everything Palm!


    <Back to Page 1
 
ImproveHomeLife.com © 2005
Terms of Use