Example usage for android.location LocationManager GPS_PROVIDER

List of usage examples for android.location LocationManager GPS_PROVIDER

Introduction

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

Prototype

String GPS_PROVIDER

To view the source code for android.location LocationManager GPS_PROVIDER.

Click Source Link

Document

Name of the GPS location 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 final 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 isGpsEnabled(Context context) {
    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
        return false;
    }/*from w  w  w  .  jav a  2 s.  c o  m*/
    return true;
}

From source file:Main.java

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

From source file:Main.java

public static boolean isGPSEnabled(Context context) {
    final LocationManager manager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

    boolean isgpsEnabled = manager.isProviderEnabled(LocationManager.GPS_PROVIDER);

    return isgpsEnabled;
}

From source file:Main.java

public static boolean checkGPSStatus(Context context) {
    boolean resp = false;
    LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
        resp = true;//from   w ww .j a v a  2 s. c o m
    }
    return resp;
}

From source file:Main.java

public static boolean isGpsConnected(Context context) {
    boolean resp = false;
    LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
        resp = true;/* www .j  a  va2 s. com*/
    }
    return resp;
}

From source file:Main.java

public static boolean isLocationEnabled(Context context) {

    LocationManager service = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
    boolean isEnabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER)
            && service.isProviderEnabled(LocationManager.NETWORK_PROVIDER);

    return isEnabled;

}

From source file:Main.java

public static boolean isOpenGPS(Context context) {
    LocationManager manager = (LocationManager) context.getSystemService(Activity.LOCATION_SERVICE);
    return manager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

From source file:Main.java

public static boolean isGPS(Context context) {
    LocationManager lmLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

    Boolean isGPS = lmLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);

    return isGPS;
}