开发者

how to check internet availability in j2me

How to check internet availability on mobile application...开发者_StackOverflow社区. in j2me....


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.


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜