android: how to manage 4g if used SDK 2.1 (meaning no WIMAX)
there is a possibility to manage 4G in API 2.1 (level 7). I did it in following way
final ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm==null)
return false;
final NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork==null)
return false;
// determine the type of network
switch (activeNetwork.getType()){
case 6:
isInternetWiMax = true;
break;
case ConnectivityManager.TYPE_WIFI:
isInternetWiFi = true;
break;
case ConnectivityManager.TYPE_MOBILE:
isInternetMobile = true;
break;
}
精彩评论