How we can open brow开发者_运维知识库ser through Java ME code in ubuntu os ?
I am using the below given code
String URL1="any url";
midlet.platformRequest(URL1);
The above line does not open the browser in the UBUNTU 10.10 but its working fine on windows os.
Please help me if any body else have faced the same problem.
if you use emulator (which one?), check if it is properly configured (emulators tend to have stuff like that in User Guide y'know)
- eg this article provides a recipe for WTK / ME SDK:
...The J2ME Wireless Toolkit supports the
platformRequest()
method, but before using the method you must tell the toolkit what to do when it's invoked. You can associate only one platform service withplatformRequest()
. For instance, if for testing purposes you associate the method with your browser, the browser will be launched every time you callplatformRequest()
. If you need more flexibility, you can associateplatformRequest()
with a script that will use the URL scheme to route the request to the right handler.To associate a particular platform service with
platformRequest()
, simply add acom.sun.midp.midlet.platformRequestCommand
attribute to thesystem.config
file in the toolkit's lib directory. For example, to invoke the Mozilla browser wheneverplatformRequest()
is called, add the following tosystem.config
:# Associate the Mozilla browser with platformRequest() - Windows com.sun.midp.midlet.platformRequestCommand: "C:\Program Files\mozilla.org\Mozilla\mozilla.exe"
Given this setting, the call
platformRequest("http://developers.sun.com/mobility")
will launch Mozilla, and the browser will navigate to Sun's developer mobility portal...
精彩评论