Detecting “use only 2G networks” setting
Is there a way of returning the value of Android's mobile network setting for "use only 2G networks"? The app being developed measures the internet speed at a certain location, but in order for this to be relevant, it must know if the user is deliberately restricting mobile internet to 2G. I've taken a look at ConnectivityManager, but it only provides information about the background data setting or all networks. Iterating through them reveals that despite the setting being enabled, HSPA and UMTS return true for isAvailable() : for (NetworkInfo netInfo : cm.getAllNetworkInfo()) { Log.i(TAG,