如何使用 JavaMe 在默认浏览器中打开链接?
需要跨设备 - 适用于支持 JavaME 的每个移动制造商 -
特别是:当应用程序打开时,它会重定向到移动设备默认浏览器中的(有线)链接。
找到了如何在非移动 Java 应用程序中执行此操作,但尚未找到 JavaME 的示例。
我正在使用 JavaME、Sun Java Wireless Tool Kit 2.5.2 和 eclipseME。
编辑: 我正在尝试这样做:
try {
platformRequest("http://www.stackoverflow.com");
destroyApp(true);
notifyDestroyed();
} catch (ConnectionNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但不确定它是否适用于所有平台。另外,为什么应用程序必须被销毁?
Need to be cross-device -working for every mobile manufacturer that gives support to JavaME-
In particular: when the application is open, it redirects to a (cabled) link in the default browser of the mobile device.
Found how to do it in a not mobile Java app, but have not found example for JavaME.
I'm using JavaME, with Sun Java Wireless Tool Kit 2.5.2, and eclipseME.
EDIT:
I'm trying to do:
try {
platformRequest("http://www.stackoverflow.com");
destroyApp(true);
notifyDestroyed();
} catch (ConnectionNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
But not sure about if it will work in all platforms. Also, why the app must be destroyed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好了,是这样的,请看一下代码的注释:
另外,如果你是在Linux下,你必须为模拟器设置一个默认浏览器。转到
yourPath/Java/lib/system.config
并在最后添加以下行:(当然可以是其他浏览器)
现在在模拟器中运行它。或者创建 .jad 和 .jar 并在您的物理手机中运行它。
Well, this is how, please read the comments of the code:
Also, if you are under Linux, you must set a default browser for the emulator. Go to
yourPath/Java/lib/system.config
and, at the end, add the following line:(could be another browser of course)
Now run it in your emulator.Or create the .jad and .jar an run it in your physical phone.