is Network Enable - Android Network

Android examples for Network:Network Status

Description

is Network Enable

Demo Code


//package com.java2s;

import android.content.Context;
import android.location.LocationManager;

public class Main {
    public static boolean isNetworkEnable(Context ctx) {

        LocationManager locationManager = (LocationManager) ctx
                .getSystemService(Context.LOCATION_SERVICE);
        return locationManager
                .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    }//from  ww w.jav a  2 s .c  o m
}

Related Tutorials