android 判断联网类型

ConnectivityManager manager = (ConnectivityManager)               
    
aContext.getSystemService(Context.CONNECTIVITY_SERVICE);     
NetworkInfo info = manager.getActiveNetworkInfo();     
String networktype=info.getTypeName();     
       
  
加权限  
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >  
</uses-permission>  
<uses-permission android:name="android.permission.INTERNET" />  

你可能感兴趣的:(android)