How can I determine the current internet connection type available to an Android device? e.g. have it return WiFi, 3G, none.
+2
A:
Use android.net.ConnectivityManager
, specifically getActiveNetworkInfo()
. You can see a somewhat-related example snippet here.
CommonsWare
2009-11-15 16:47:35
A:
You can also use the TelephonyManager to find out what the mobile network type is:
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
int networkType = telephonyManager.getNetworkType();
Possible network types are listed at http://developer.android.com/reference/android/telephony/TelephonyManager.html#NETWORK%5FTYPE%5F1xRTT
AshtonBRSC
2009-11-16 00:27:56