location-services

Background location service is not working in oppo and MI phones

吃可爱长大的小学妹 提交于 2019-12-12 08:59:20
问题 In my android application,location service is implemented as background service.I have tested it with different phones(like samsung,micromax,Moto,lenovo,nexus) it works fine with all.But when i run in Oppo (colorOS) and MI (MIUI OS),my service is get stopped after some time interval.I have finished MainActivity with MainActivity.this.finish(). 回答1: put following code on your activity above oncreate() method: private FusedLocationProviderClient mFusedLocationClient; EasyPermissionsLocation

Enable location services for Android if user chose Never option

佐手、 提交于 2019-12-12 08:22:50
问题 Is there any way to allow location services again for an app (or at least show the dialog) if the user previously chose the option Never? I dont find any way in code to show it again, since i always get LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE in the onResult(..) callback: @Override public void onResult(LocationSettingsResult locationSettingsResult) { final Status status = locationSettingsResult.getStatus(); switch (status.getStatusCode()) { case LocationSettingsStatusCodes

Android current location marker ID (name)

喜夏-厌秋 提交于 2019-12-12 05:44:19
问题 I am pretty much a novice at Android development, so please feel free to describe in very simple terms any advice you may give in response to my query. I would like my application to start by displaying an Activity zoomed out to an extent that shows both my current location and that of a marker that I have placed on a map some distance from me. I have successfully placed and displayed the remote marker the on the map and have found this class: LatLngBounds.Builder, which allows me to

How to enable Location Services for a WKWebView in Swift?

若如初见. 提交于 2019-12-12 02:55:53
问题 My Browser app uses WKWebView but when I try to visit a website that needs to use Location Services (like Google Maps, for example), it doesn't work. I have searched for a way to fix it and came across this question. I tried to add the string on the answer to the question to my Info.plist but it doesn't resolve the issue. How can I fix this? Thanks, PastaCoder 回答1: I'm not sure how, but trying to add a string for NSLocationWhenInUseUsageDescription in the Info.plist did work yesterday and the

Google Play Services or Android Location Services

只谈情不闲聊 提交于 2019-12-10 21:26:42
问题 I am wanting to implement location based functionality in my app. I have been reading a bit and I find my self a bit confused. When googling for tutorial almost every result comes back with an example using Android Location API. However when reading the android developer guidelines they state the following: The Google Play services location APIs are preferred over the Android framework location APIs (android.location) as a way of adding location awareness to your app. If you are currently

Fused location API gives highly inaccurate location after closing google maps

给你一囗甜甜゛ 提交于 2019-12-07 18:35:18
问题 Our application uses Google Fused location API to receive location updates every 3 minutes. The location request settings are as follows – Interval – 3min Fastest interval – 1 min Priority - PRIORITY_BALANCED_POWER_ACCURACY In a normal running scenario, the location updates are received properly and the location accuracy is pretty good (around 20-25 m). When the Maps application is opened, it received GPS location, and therefore our application also starts receiving location updates, which

FusedLocationApi Background Location service stops receiving updates randomly

﹥>﹥吖頭↗ 提交于 2019-12-07 10:25:00
问题 i'm trying to use FusedLocationApi with pending intent to get period location updates so i can send the data to some server for processing. Everything works. However, there are some instances where the broadcast just stops receiving. I would need to restart the service again in order for it to continue. I already have the service onStartCommand to return START_STICKY so even if the app is killed it should start the service again. Furthermore, I also added a Boot Completed Intent Receiver so

Fused location API gives highly inaccurate location after closing google maps

谁说胖子不能爱 提交于 2019-12-06 11:22:22
Our application uses Google Fused location API to receive location updates every 3 minutes. The location request settings are as follows – Interval – 3min Fastest interval – 1 min Priority - PRIORITY_BALANCED_POWER_ACCURACY In a normal running scenario, the location updates are received properly and the location accuracy is pretty good (around 20-25 m). When the Maps application is opened, it received GPS location, and therefore our application also starts receiving location updates, which are basically from the GPS transceiver (I know this as the subsequent location updates have a speed and

FusedLocationApi Background Location service stops receiving updates randomly

烈酒焚心 提交于 2019-12-05 15:36:25
i'm trying to use FusedLocationApi with pending intent to get period location updates so i can send the data to some server for processing. Everything works. However, there are some instances where the broadcast just stops receiving. I would need to restart the service again in order for it to continue. I already have the service onStartCommand to return START_STICKY so even if the app is killed it should start the service again. Furthermore, I also added a Boot Completed Intent Receiver so if the phone died and user restarted phone it would restart my service. So it seems everything is fine

Enable location services for Android if user chose Never option

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 00:27:06
Is there any way to allow location services again for an app (or at least show the dialog) if the user previously chose the option Never? I dont find any way in code to show it again, since i always get LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE in the onResult(..) callback: @Override public void onResult(LocationSettingsResult locationSettingsResult) { final Status status = locationSettingsResult.getStatus(); switch (status.getStatusCode()) { case LocationSettingsStatusCodes.SUCCESS: Log.i(TAG, "All location settings are satisfied."); // startLocationUpdates(); break; case