如何在j2me中检查互联网可用性

发布于 2024-10-13 15:33:54 字数 39 浏览 5 评论 0原文

如何在 j2me 中检查移动应用程序上的互联网可用性......

How to check internet availability on mobile application.... in j2me....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天赋异禀 2024-10-20 15:33:54

使用此属性可检测 s40 系列手机上可用的 GPRS 连接。

com.nokia.network.access

它返回网络接入点类型。此属性的可能值为:

* pd — Packet data, for example GPRS
* csd — Circuit-switched data, for example GSM CSD/HSCSD data call
* bt_pan — Bluetooth PAN network
* na — Not applicable, the implementation cannot determine the type r

有关详细信息,请参阅此 wiki 链接< /a>.

您还尝试访问 url 来验证这一点。如果出现超时或任何与连接相关的异常,则意味着网络类型不可用。

Use this property for detect the available GPRS connection on s40 series mobiles.

com.nokia.network.access

Its returns the networking access point type. the possible values for this property are:

* pd — Packet data, for example GPRS
* csd — Circuit-switched data, for example GSM CSD/HSCSD data call
* bt_pan — Bluetooth PAN network
* na — Not applicable, the implementation cannot determine the type r

For more info see this wiki link.

Also you try to access url to verify that. If you got timeout or any connection related exception means the type of network is not available.

执笔绘流年 2024-10-20 15:33:54

JavaME 中没有执行此操作的标准方法。您可能想要检查自定义供应商库,例如 Symbian JavaME 库。

您可以尝试 ping 服务器或尝试建立连接并捕获异常。但这并没有表明手机是否通常能够连接到互联网。它只是告诉您,此时您无法连接。

There is no standard way in JavaME of doing this. You might want to check custom vendor libraries, e.g. Symbian JavaME libraries.

You can try to ping a server or try to make a connection and catch the exception. But this doesn't give any indication whether the phone is generally capable of connecting to the internet or not. It just tells you, that you can't connect at that moment.

乄_柒ぐ汐 2024-10-20 15:33:54

尝试建立连接并查看是否抛出异常。

Try just making a connection and see if it throws an exception.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文