ap

  1. public String NetType(Context context) {  
  2.         try {  
  3.             ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);  
  4.             NetworkInfo info = cm.getActiveNetworkInfo();  
  5.             String typeName = info.getTypeName().toLowerCase(); // WIFI/MOBILE  
  6.             if (typeName.equalsIgnoreCase("wifi")) {  
  7.             } else {  
  8.                 typeName = info.getExtraInfo().toLowerCase();  
  9.                 // 3gnet/3gwap/uninet/uniwap/cmnet/cmwap/ctnet/ctwap  
  10.             }  
  11.             return typeName;  
  12.         } catch (Exception e) {  
  13.             return null;  
  14.         }  
  15.     }  

你可能感兴趣的:(ap)