开发者

Android Application: Got Internet Connection

开发者 https://www.devze.com 2022-12-25 00:56 出处:网络
How can I check got a successful internet connect (Wifi/3G/whatever else) I already display an error to the use开发者_如何转开发r if they don\'t have Wifi connection but how can I make sure then that

How can I check got a successful internet connect (Wifi/3G/whatever else) I already display an error to the use开发者_如何转开发r if they don't have Wifi connection but how can I make sure then that the user does got 3G connection if they wish to connect to use the application without the Wifi connection?


If you just want to see if the phone is connected to the network, you could try: ConnectivityManager.getAllNetworkInfo() and then for each network adapter check networkinfo.getState(). That should tell you whether it's connected or not. However, I'm not sure if there's a way to specifically check for 3G.

0

精彩评论

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

关注公众号