Example usage for android.location LocationManager isProviderEnabled

List of usage examples for android.location LocationManager isProviderEnabled

Introduction

In this page you can find the example usage for android.location LocationManager isProviderEnabled.

Prototype

public boolean isProviderEnabled(String provider) 

Source Link

Document

Returns the current enabled/disabled status of the given provider.

Usage

From source file:Main.java

public static boolean isGPSEnabled(Context mContext) {
    LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

From source file:Main.java

public static boolean isGPSEnabled(Context context) {
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
            || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}

From source file:Main.java

public static boolean isGpsEnabled(Context context) {
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

From source file:Main.java

public static boolean checkGPS(Context context) {
    LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    boolean GPS_status = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
    return GPS_status;
}

From source file:Main.java

public static boolean isGpsEnabled(Context pContext) {
    LocationManager locationManager = (LocationManager) pContext.getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

From source file:Main.java

public static boolean isGpsEnabled(Context context) {
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
        return false;
    }//from  w  w  w . j a va  2  s . c  o m
    return true;
}

From source file:Main.java

/**
 * This Function check the GPS enable/disable Status. Remember to add
 * required Permission in Manifest./* w w w  .j  a v  a2  s  .  co  m*/
 * 
 * See below for @params.
 */

public static boolean isGPSEnable(Context ctx) {
    LocationManager locationManager = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

From source file:Main.java

/**
 * Check Network provider is enabled for location update
 *
 * @param context/*from w w w.  j av a 2 s. c  o  m*/
 * @return if network provider enabled
 */
public static boolean isNetworkProviderEnabled(Context context) {
    final LocationManager manager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

    return manager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}

From source file:Main.java

public static boolean isOpenGPS(Context context) {
    LocationManager alm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (!alm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER)) {
        return false;
    }/*  w  w  w . j  ava  2  s  .c om*/
    return true;
}

From source file:Main.java

public static boolean isNatworkEnable(Context context) {
    LocationManager locationMgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    return locationMgr.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}