How to enable Location access programmatically in android?

Use below code to check. If it is disabled, dialog box will be generated public void statusCheck() { final LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { buildAlertMessageNoGps(); } } private void buildAlertMessageNoGps() { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(“Your GPS seems to be disabled, do you want to enable it?”) .setCancelable(false) .setPositiveButton(“Yes”, new … Read more

Fused Location Provider unexpected behavior

For the questions specified, 1. is the fused location provider suppose to use GPS at all if it set to receive updates with PRIORITY_BALANCED_POWER_ACCURACY and don’t have any WI-FI or cell towers info ? & 2. if it does, then what am I doing wrong? Apparently no explicitly unique source is specified anywhere within documentation. … Read more

Android: Google Maps location with low battery usage

FINALLY FOUND THE SOLUTION!!! thanks to Tristan for his answer! By default, GoogleMap uses its on location provider, which is not the Fused Location Provider. In order to use the Fused Location Provider (which allows you to control the location accuracy and power consumption) you need to explicitely set the map location source with GoogleMap.setLocationSource() … Read more

Location Services not working in iOS 11

It would appear that apple have added yet another privacy feature. The user is now able to override our requestAlwaysAuthorization and downgrade it to requestWhenInUseAuthorization – Which means as a developer we now have to supply both descriptions in the Info.plist I found that they have added a new key NSLocationAlwaysAndWhenInUseUsageDescription /* * Either the … Read more