Problem in Connection with internet in Java 2 Micro edition(J2ME)

1.1k Views Asked by At

I am trying to connect to internet through my J2ME application. I am using NetBeans 6.8. I am trying to establish an HttpConnection between my J2ME MIDP and Internet. I am not getting the webpage that i am passing as a parameter in Connector.open() method. i.e

conn = (HttpConnection)Connector.open("www.google.com");

After running the program i cant see google in my mobile, though my application is asking me for a secure internet connection. If anyone know about Http Connection with J2ME then, please help me.

2

There are 2 best solutions below

0
On

See these links. Here clearly described how to use HttpConnection with examples in J2ME.

Use the platformRequest(String URL) method. This will open the devices default browser.

0
On

Bear in mind that these solutions are unlikely to help with

i cant see google in my mobile

because Java ME doesn't come with an HTML rendering widget. If you'd like to launch Google from your midlet, you're best to do it in the device's browser, using MIDlet.platformRequest().