Forums Register Login

CLDC-HTTP communication.I am not getting any error ?

+Pie Number of slices to send: Send
Hi ,
I am developing a Palm App with J2ME and CLDC API's.
I made a sample application and tested in Kyocera Palm device and i am so thrilled to run it.
Now i want to make my application to communicate with a remote Oracle database.For this i am planning to make my Palm application to talk with Servlets in a webserver, so that i can send and recieve data extensively.
But i am not able to do the communication module successfully.
I tried out a sample code and it didn't throw any exception and the return values of every function said it is sucess.So i thought i did all !!!
And later i tried with a jung (invalid) URL and i got shocked to see the same result ..i mean no error.All the branches of the program returned success values.
What does it mean ??? So my application actually not contacting any URL. Otherwise it should throw some invalid URL exception.....right ?
But in both the cases the number of bytes returned by read function was 0 and none of the other connection function throwed any exception,
like connect(),OpenInputStream...etc.
This is my sample code.

-----------------------------------------------------------------

StreamConnection m_Conn = null; //Connection

DataInputStream m_In = null; //Input Stream

String sURL = "http://63.221.48.58:8080/servlets/AirScriptLogin";

try

{

StringBuffer sbInput = new StringBuffer("");

int iData;

int iCount = 0;

m_Conn = (StreamConnection)Connector.open(sURL,Connector.READ_WRITE,true);

m_In = m_Conn.openDataInputStream();

for(iCount = 0 ; (iData = m_In.read()) > 0 ; iCount++)

{

sbInput.append((char)iData);

}

m_In.close();


MsgTxtBox.setText("Recd :"+sbInput.toString());

MsgTxtBox.paint();

}

catch (RuntimeException e)

{

MsgTxtBox.setText(e.getMessage());

MsgTxtBox.paint();

}

catch (Exception e)

{

MsgTxtBox.setText(e.toString());

MsgTxtBox.paint();

}

------------------------------------------------------------------------

If i understood anything wrongly pls correct me.And pls tell me what should i do....i am really in a trouble.
Pls let me know if u need any more info ,so that u can give me a better reply.
Hope to hear from u soon.
Thanks and Regards
Joe Augustine
+Pie Number of slices to send: Send
Haven't tried any of it on the Kyocera. Note that the "http:" protocol only works on Palm devices that support web clipping, and that you have to configure the device to use the Palm.Net gateway. The "testhttp:" protocol works as long as you've configured your device to use a PPP connection. I think the latter is more what you'd want. However, note that both protocols as implemented in the Palm CLDC are strictly experimental and have problems. I wouldn't try building any real apps with them, you should rather wait until Sun releases its MIDP implementation for the Palm, which will have proper HTTP support.
Eric
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1397 times.
Similar Threads
simple login - help asp
new to JDBC - please help!
Wireless connection speed for J2ME app on Palm VIIx device
Is J2ME an ideal tool ...right now ????
Palm VIIx Wireless application??
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:58:19.