Return to Snippet

Revision: 52042
at October 12, 2011 01:29 by chrisaiv

Initial Code
public boolean isOnline() {
 ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
 return cm.getActiveNetworkInfo().isConnectedOrConnecting();


Initial URL

Initial Description
Need to check if your device is online before sending/getting a request? Here's how.

Initial Title
Java: Checking Internet Connectivity

Initial Tags

Initial Language