Problem in Connection with internet in Java 2 Micro edition(J2ME)
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 开发者_如何学JAVAam 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.
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()
.
See these links. Here clearly described how to use HttpConnection with examples in J2ME.
- Http connection in j2me
- Networking with J2ME
Use the platformRequest(String URL) method. This will open the devices default browser.
精彩评论