954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

connecting to gmail using j2me

I have tried to connect to gmail using IMAP and specification given on http://mail.google.com/support/bin/a...n&answer=78799 .

My code looks like

StreamConnection socket;
byte serverData[]= new byte[50];
byte accountInfo[],emailAddInfo[]=new byte[500];
try
{
socket = (StreamConnection)Connector.open("socket://imap.gmail.com:993");

DataOutputStream oStrm = socket.openDataOutputStream();
oStrm.writeChars("Account Name:username@your_domain.com");//my account name
oStrm.writeChars("Email Address:username@your_domain.com");//my email address

InputStream iStrm = socket.openInputStream();
iStrm.read(serverData);
String str= new String(serverData);
System.out.println(str);
list.append(str, null);
for (int i = 0; i < serverData.length; i++)
{
System.out.println(serverData[i]);
}
iStrm.close();

} catch Exception


........

But response from gmail server is empty... Server data is printing streams of 0's...

help me finding out the issue...

ni30rocks
Newbie Poster
3 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: