Last Updated: February 25, 2016
·
1.058K
· raulraja

Android Check Connectivity

Check if your app has connectivity

boolean hasConnectivity = true;
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo info = cm.getActiveNetworkInfo();
hasConnectivity = info != null 
&& (info.isConnected() 
|| (roamingOK && info.isRoaming()));

1 Response
Add your response

and then get the network ssid and mass announce the mac address! bad android! :)

over 1 year ago ·