如何在j2me中检查互联网可用性
如何在 j2me 中检查移动应用程序上的互联网可用性......
How to check internet availability on mobile application.... in j2me....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 j2me 中检查移动应用程序上的互联网可用性......
How to check internet availability on mobile application.... in j2me....
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
使用此属性可检测 s40 系列手机上可用的 GPRS 连接。
它返回网络接入点类型。此属性的可能值为:
有关详细信息,请参阅此 wiki 链接< /a>.
您还尝试访问 url 来验证这一点。如果出现超时或任何与连接相关的异常,则意味着网络类型不可用。
Use this property for detect the available GPRS connection on s40 series mobiles.
Its returns the networking access point type. the possible values for this property are:
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.
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.
尝试建立连接并查看是否抛出异常。
Try just making a connection and see if it throws an exception.