load the phone browser?

Hi is their a tutorial/sample code that loads the phones web browser to display and connect to a particular web address?thanks in advance
[151 byte] By [jonney69a] at [2007-11-26 21:25:27]
# 1

platformRequest

public final boolean platformRequest(String URL)

throws ConnectionNotFoundException

Requests that the device handle (for example, display or install) the indicated URL.

If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MIDlet suite running in the background. If the platform does not have appropriate capabilities or resources available, it MAY wait to handle the URL request until after the MIDlet suite exits. In this case, when the requesting MIDlet suite exits, the platform MUST then bring the appropriate application (if one exists) to the foreground to let the user interact with the content.

This is a non-blocking method. In addition, this method does NOT queue multiple requests. On platforms where the MIDlet suite must exit before the request is handled, the platform MUST handle only the last request made. On platforms where the MIDlet suite and the request can be handled concurrently, each request that the MIDlet suite makes MUST be passed to the platform software for handling in a timely fashion.

If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file), the application handling the request MUST interpret it as a request to install the named package. In this case, the platform's normal MIDlet suite installation process SHOULD be used, and the user MUST be allowed to control the process (including cancelling the download and/or installation). If the MIDlet suite being installed is an update of the currently running MIDlet suite, the platform MUST first stop the currently running MIDlet suite before performing the update. On some platforms, the currently running MIDlet suite MAY need to be stopped before any installations can occur.

If the URL specified is of the form tel:<number>, as specified in RFC2806, then the platform MUST interpret this as a request to initiate a voice call. The request MUST be passed to the "phone" application to handle if one is present in the platform. The "phone" application, if present, MUST be able to set up local and global phone calls and also perform DTMF post dialing. Not all elements of RFC2806 need be implemented, especially the area-specifier or any other requirement on the terminal to know its context. The isdn-subaddress, service-provider and future-extension may also be ignored. Pauses during dialing are not relevant in some telephony services.

Devices MAY choose to support additional URL schemes beyond the requirements listed above.

Many of the ways this method will be used could have a financial impact to the user (e.g. transferring data through a wireless network, or initiating a voice call). Therefore the platform MUST ask the user to explicitly acknowlege each request before the action is taken. Implementation freedoms are possible so that a pleasant user experience is retained. For example, some platforms may put up a dialog for each request asking the user for permission, while other platforms may launch the appropriate application and populate the URL or phone number fields, but not take the action until the user explicitly clicks the load or dial buttons.

Parameters:

URL - The URL for the platform to load. An empty string (not null) cancels any pending requests.

Returns:

true if the MIDlet suite MUST first exit before the content can be fetched.

Throws:

ConnectionNotFoundException - if the platform cannot handle the URL requested.

Since:

MIDP 2.0

suparenoa at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Thanks i will have a little go at this and see if it works,thanks again supareno
jonney69a at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

update: i have tried the code below and i get an error stating that the method platformRequest cannot be found

boolean b;

try

{

b = platformRequest("http://www.google.com");

}

catch(Exception e)

{

}

Message was edited by:

jonney69

jonney69a at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
...Since:MIDP 2.0
suparenoa at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
yes i know, i am using MIDP 2.0 project and i've looked at all the api's even this one http://java.sun.com/javame/reference/apis/jsr118/ and there is not mentioning of a platformRequest methodMessage was edited by: shienna17
shienna17a at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
are you doing it in a class that extends MIDlet?
suparenoa at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
o i c, im tryng to do it in a canvas thats why. is there a way to achieve this platformRequest in a canvas?Message was edited by: shienna17
shienna17a at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8

> o i c, im tryng to do it in a canvas thats why. is

> there a way to achieve this platformRequest in a

> canvas?

having a reference to the MIDlet root

for example:

/*

* your custom canvas

*/

public class MyCanvas{

MIDlet root=null;

// blabla

public MyCanvas(MIDlet midlet){

root=midlet;

// blabla

}

// blabla

...

// in your keypressed method or whatever...

root.platformRequest("the_url_that_i_wanna_load_in_the_mobile_browser");

...

}

suparenoa at 2007-7-10 3:05:43 > top of Java-index,Java Mobility Forums,Java ME Technologies...