Reconnect to GPRS from J2ME

455 views Asked by At

I have a little problem. I have developed a midlet application that call some webservices through internet. I'm using cell phones with GPRS connection. For some time it runs as I wanted, run the apps, call the webservices through the GPRS, it returns the result, call the webservices again, and so on.

But say, I call the webservices and after the apps return the result I needed, I left it for a while. The next time I continue to access the webservices, the apps takes a while to connect through the GPRS. In nokia, it is marked with a G in a box. In SE it is marked with a glowing globe. This 'G' in the box or the glowing globe will appear after a while or won't appear at all, but the apps is still trying to connect to the internet.

Does it come from my apps or it come from the cell phone? And could I know [or the apps knows] that at the moment the apps tries to connect the GPRS is ready?

Thanks a lot for your responses...

1

There are 1 answers

0
Eric Giguere On BEST ANSWER

There is nothing in Java ME (i.e. J2ME) that can control whether or not the device is connected, unfortunately. All you can do is try to connect.

Make sure you are properly closing all your connections, though. Including the HttpConnection object, not just the input/output streams.