I am working with my ipad app. With my iPad 3G,it's a trouble that i can't solve. I want to distinguish between 3G network and wifi in my app. Anyone had encountered the same problem before? any advice welcomed! Thanks!
Asked
Active
Viewed 3,456 times
3 Answers
3
You want the "reachability" API that is discussed here.

Community
- 1
- 1

Joshua Nozzi
- 60,946
- 14
- 140
- 135
-
Did you follow both links I gave you? The second link (to another question here on StackOverflow) even gives a complete code listing that shows the answer is yes. – Joshua Nozzi Nov 08 '10 at 18:08
-
Thanks for your answer, I just want to confirm this questions again. Because I am at home now and don't have 3G card to verify. – snail Nov 08 '10 at 18:23
-4
You can use this to distinguish 3G or WIFI network~
//For 3G check
boolean is3g = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE)
.isConnectedOrConnecting();
//For WiFi Check
boolean isWifi = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI)
.isConnectedOrConnecting();

珠帘暮卷西山雨
- 1