Using the old Android location manager, you can detect whether location is enabled for GPS (and similarly for network location) using:
LocationManager x = (LocationManager) getSystemService(Activity.LOCATION_SERVICE);
boolean isGPSEnabled = x.isProviderEnabled(LocationManager.GPS_PROVIDER);
Is there a new way of doing this with the Google Play services location APIs? The documentation suggests
If you are currently using the Android framework location APIs, you are strongly encouraged to switch to the Google Play services location APIs as soon as possible.
https://developer.android.com/training/location/index.html https://developer.android.com/reference/com/google/android/gms/location/package-summary.html