开发者

How we can open browser through j2me code in ubuntu os?

开发者 https://www.devze.com 2023-04-05 22:39 出处:网络
How we can open brow开发者_运维知识库ser through Java ME code in ubuntu os ? I am using the below given code

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 with platformRequest(). For instance, if for testing purposes you associate the method with your browser, the browser will be launched every time you call platformRequest(). If you need more flexibility, you can associate platformRequest() 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 a com.sun.midp.midlet.platformRequestCommand attribute to the system.config file in the toolkit's lib directory. For example, to invoke the Mozilla browser whenever platformRequest() is called, add the following to system.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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号