How do you detect the network connection type on Android?
Is it through ConnectivityManager.getActiveNetworkInfo().getType(), and is the answer limited to Wifi and mobile?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the problem is to find whether the phone’s network is connected and fast enough to meet your demands you have to handle all the network types returned by
getSubType().It took me an hour or two to research and write this class to do just exactly that, and I thought I would share it with others that might find it useful.
Here is a Gist of the class, so you can fork it and edited it.
Also make sure to add this permission to you AndroidManifest.xml
Sources for network speeds include wikipedia & http://3gstore.com/page/78_what_is_evdo_mobile_broadband.html