location-services

How to enable Location access programmatically in android?

那年仲夏 提交于 2019-11-26 22:36:28
问题 I am working on map related android application and I need to check location access enable or not in client side development if location services is not enable show the dialog prompt. How to enable "Location access" Programmatically in android? 回答1: 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

Fused Location Provider unexpected behavior

若如初见. 提交于 2019-11-26 12:39:51
问题 this is how I register my app to receive location updates: mLocationRequest = LocationRequest.create(); mLocationRequest.setInterval(Consts.ONE_MINUTE * 10); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); mLocationRequest.setFastestInterval(Consts.ONE_MINUTE); Builder builder = new GoogleApiClient.Builder(context); builder.addApi(ActivityRecognition.API); mGoogleApiClient = builder.addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build();

Android: Google Maps location with low battery usage

耗尽温柔 提交于 2019-11-26 10:32:54
问题 My app is currently using Maps by Google Play Services speficying: mMap.setMyLocationEnabled(true); I realize each time I am displaying the map in my app: the location is indicated on the map by a blue dot a location icon is displaying in the top bar if I go into Settings/Location of the phone, my app is reported as \"High battery use\" However, I can see there are apps that use Maps and still show the location blue dot, but the location icon doesn\'t appear in top bar and their battery usage

Location Services not working in iOS 11

久未见 提交于 2019-11-26 06:35:26
问题 I just rebuilt my app with the iOS 11 SDK in an attempt to remove the blue banner that is now always appearing. I thought - \"Brilliant, that worked\", only to discover that location services are now not working at all. The application used to work with iOS 10 - Has anybody heard anything? 回答1: 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