×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Bangalore,India
    Posts
    306

    launching browser

    Hi
    Can i launch browser from my java applicaton?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    7

    Re: launching browser

    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");

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: launching browser

    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

  4. #4
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: launching browser

    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

  5. #5
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Mumbai
    Posts
    212

    Question Re: launching browser

    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???

  6. #6
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Mumbai
    Posts
    212

    Re: launching browser

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×