Android GPS State Check isGpsEnabled(Context c)

Here you can find the source of isGpsEnabled(Context c)

Description

is Gps Enabled

License

Open Source License

Declaration

public static boolean isGpsEnabled(Context c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static boolean isGpsEnabled(Context c) {
        LocationManager service = (LocationManager) c
                .getSystemService(Context.LOCATION_SERVICE);
        return service.isProviderEnabled(LocationManager.GPS_PROVIDER);
    }//from   w w w. java  2  s  . c om
}

Related

  1. isSameGPSLocation(double lon, double lat, double lon1, double lat1)