Hi
Can i launch browser from my java applicaton?
Hi
Can i launch browser from my java applicaton?
Yes, you can if your phone supports MIDP 2.0.
You've to use the platformRequest method of the MIDlet class:
myMIDlet.platformRequest("http://wap.mdfactory.com");
You should also check the return value of this method: true if the application needs to be closed in order for the request to be performed; false otherwise.
Daniel
http://developers.sun.com/techtopics...atformRequest/
Note:
The MIDP 2.0 specification defines two URL schemes and corresponding platform services:
* If the URL points to a MIDlet suite's JAD or JAR file, for example http://www.j2medeveloper.com/ota/basicpush.jad, the platform request is for download and installation of the MIDlet suite, using the platform's normal installation process;
* If the URL scheme is tel:, for example tel:+358-555-1234567, the URL must be passed to the device's application responsible for initiating voice calls.
Device manufactures are free to implement additional platform services. For example, one likely platform service would be to invoke a web browser when the MIDlet supplies an http: URL such as
http://developers.sun.com/techtopics/mobility
I have used platformRequest to launch browser with a url.
After the platformRequest call i quit the application and the browser takes over.
It works fine for most of the MIDP2 phones,
But for Nokia 6030 quitting the app hangs the phone.
And after removing the Quitting code ie
destroyApp(true);
notifyDestroyed();
the app worked but i have to manually exit the application.
Details: when i run the app on 6030 with the quit code it hangs and without quit code it says "Application running in background". And now when i quit the app i get the browser with the url.
What can be the workaround to this???
Hi Thr !
I went through your post in forum Nokia.. Interesting
I'm also using PlatformRequest to launch browser with
url in my J2me application. It works fine in Emulator but
when deployed to the mobile device it fails to launch.
Can u advice me with your experiance. It thr any setting
to me made in manifest file or elsewhere ?.
----ahmed@tmrnd.com.my
Hi ahmed -- try this
public class Launcher extends MIDlet {
Alert alert;
public void startApp() {
boolean b;
try {
b=platformRequest("http://www.mytoday.com/");
destroyApp(true);
notifyDestroyed();
}
catch (ConnectionNotFoundException ex)
{
ex.printStackTrace();
}
destroyApp(true);
notifyDestroyed();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
Avinash Rathod