How to Invoke Mobile WAP Browser via MIDP !

Hello ALL,

I am very new to J2ME World, my intention is to open BBC news wap site in my Default Mobile WAP Browser via a MIDP.

For that i had executed the below code:

HelloMidlet.java

===============

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

public class HelloMidlet extends MIDlet {

public HelloMidlet() {

}

public void startApp() {

}

HelloMidlet h;

public void launchApp(String url){

try{

boolean test = h.platformRequest("http://www.bbc.co.uk");

}catch(Exception e){

System.out.println("problem with the connection.."+e);

}

}

public void pauseApp() {

}

public void destroyApp(boolean unconditional) {

}

}

===============

Test Result

===============

Project settings saved

Building "HelloMidlet"

Build complete

Running with storage root DefaultColorPhone

Testing

===============

But the emulator is not displaying BBC pages when i am trying to click on "Launch" button

Also when i installed and tested in my Nokia Handset it is displaying the following text after opening:

"%U running. Nothing to display"

Please if some one can modify the above code and send back so that i can open BBC site in my mobile Browser via MIDP

Many Many thanks in advance.

J2meWare

[1434 byte] By [j2mewarea] at [2007-10-3 11:44:21]
# 1

Hi,

this is a very minor mistake. m8 be because of as u r new to JavaME.

To make ur code executable, u have to make two changes to ur code.

1. Call launchApp() from within startApp() as this is the start point of any MIDlet.

2. Use

this.platformRequest()

instead of

HelloMidlet h;

h.platformRequest()

Hope ur code will run.

Regds.

SUVRO

find_suvro@SDNa at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Hello,

And thanks for your reply.

I had made the changes as follows but it is not opening WAP Browser in my Handset insted it is displaying the following messages: "%U running Nothing to display"

Please Help me in solving this problem...

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

public class HelloMidlet extends MIDlet {

public HelloMidlet() {

}

public void startApp() {

launchApp();

}

public void launchApp(){

try{

boolean test = this.platformRequest("http://www.bbc.co.uk");

}catch(Exception e){

System.out.println("problem with the connection.."+e);

}

}

public void pauseApp() {

}

public void destroyApp(boolean unconditional) {

}

}

j2mewarea at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Any one Please try to help me... I am very near to the solution....
j2mewarea at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

Well,

Check certain things,

>> if the page u are calling is a containing WML content.

>> I think this page is a html. So it will open up the Html browser. Check if ur phone supports html browsing.

>> Also check if u are subscribed to accessing internet browsing through ur phone. just try to open the same page in ur mobile through browser.

Regds.

SUVRO

find_suvro@SDNa at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

plz plz .... plz call platformRequest(url) directly in startApp() as these methods are in same class u can call directly. not needed to access by objects....

thus the wap browser of phone will be opened and wap page will be displayed

if still not getting the result there is mistake in connection settings and wap page you are fetching

@rjun

Message was edited by:

@rjun

arjunamatea at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
Don't forget what it has been suggested in the other J2ME forum that you posted your problem, and check the return value of platformRequest.Mihai
Printisora at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7

Hello ALL,

The problem of invoking Mobile WAP bowser was sloved.

The Above code works on all Handsets except (Nokia 6233).

The only problem was with my N-6233 which is continuiosly displaying me error messages ""%U running. Nothing to display""

But the same jar/jad works on all other handsets without any trouble..

Thanks to all for your support and for your patience.

Regards

J2meWare

j2mewarea at 2007-7-15 14:16:27 > top of Java-index,Java Mobility Forums,Java ME Technologies...