fusedlocationproviderapi

Even PRIORITY_HIGH_ACCURACY gives very low accuracy location updates

不羁岁月 提交于 2020-01-04 05:39:10
问题 I'm using FusedLocationAPI to get high accuracy location updates (with 2 second update interval and 5 second fastest interval) . It works fine most of the times. But, sometimes it gives accuracy like 1200m. I understand that in the beginning it can happen. But, the problem I'm having is, I get fair (~20m accuracy) updates for a while and then suddenly switches to ~1200m accuracy. How can this happen in Fused API? 回答1: Sometimes it happens. Moreover, erroneous location fixes can arrive for 5

Android O, Background Service is running for more than 30 minutes. Why?

微笑、不失礼 提交于 2020-01-01 11:37:12
问题 I am using FusedLocationProvider API to register some Geofences with PendingIntent, when my app gets started (app was manually killed to trigger this behavior) via Geofence event, I start a background service to do some work. In this Service I create a separate background thread to do some long running tasks and I acquire a wake-lock so that I am sure my tasks are completed. The Service keeps running for longer period of times (30 - 50 minutes) even though It shouldn't be. It shouldn't be

FusedLocationProvider using intentservice for background location update: location update does not work when pendingintent has a bundle added

旧街凉风 提交于 2020-01-01 07:04:31
问题 I have been looking for an answer for this question for a long time and no one seemed to have an answer. I am trying to subscribe to location updates, using Google's latest FusedLocationProviderAPI. I have followed tutorial online and it works by getting my location every now and then using intentservice triggered by requestLocationUpdates. Moving on, I try to add pass a custom class of object "User" to my intentservice. This custom class would allow me to upload the location to my server for

Should i need to unregister locationcallback for fusedLocationProviderClient?

谁都会走 提交于 2019-12-24 11:29:49
问题 i am trying to get user's location in background using service. I am using FusedLocationProviderClient for complete this task and i am doin all this thing in my service class. I am providing two button named "Yes" and "No" to user. When user press "Yes" i am starting service and if user press "No" i stop the service. Actual problem arise when once user press "Yes" button and then press "No".let me provide complete scenario step by step. User press "Yes" button so i am starting service and in

Not Able To Upgrade Gps settings to high Accuracy using FusedLocationProvider In some devices

时光怂恿深爱的人放手 提交于 2019-12-24 10:50:17
问题 I am using SettingsApi and FusedLocationProvider to upgrade Gps settings and getting location updates, I want High accuracy location updates for that I am showing Turn on gps dialog using SettingsApi to upgrade GPS settings to High Accuracy but in some devices (like Mi and Gionee) even if the user has clicked OK button in Turn On Gps Dialog I am getting RESULT_CANCELED on onActivityResult while everything is working perfectly fine in other devices like Motorola, Lenovo When User is Clicking

Android location update with fusedApi, only if am moving

ぃ、小莉子 提交于 2019-12-24 04:53:15
问题 How to get location update for every 1000 meter,ie update only if am moving ,with fused api integration. 回答1: When you are building your LocationRequest to be used by the FusedLocationApi you can use the method setSmallestDisplacement(...) as specified in the documentation like below: locationRequest.setSmallestDisplacement(1000); Note that the argument is in meters. 来源: https://stackoverflow.com/questions/35249408/android-location-update-with-fusedapi-only-if-am-moving

Cannot resolve symbol 'FusedLocationProviderClient'

纵然是瞬间 提交于 2019-12-24 03:21:11
问题 I having a error Cannot resolve symbol 'FusedLocationProviderClient' while declaring private FusedLocationProviderClient mFusedLocationClient; The same is asked here Cannot Resolve Symbol: FusedLocationProviderClient. Google play services version used 11.0.1 . But still am having the error while using the latest play services. 回答1: FusedLocationProvider is part of play-services-location. You are using play-services-maps. Add dependency : compile 'com.google.android.gms:play-services-location

FusedLocationApi with PendingIntent is fired only once and its null

空扰寡人 提交于 2019-12-23 02:42:20
问题 Am working on an app that needs location update frequently even when its in the background. Following the documentation here, am working with pending intent not locationlistener. My code is below /** * Created by philip on 7/30/16. */ public class LocationService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{ private GoogleApiClient mGoogleApiClient; private LocationRequest mLocationRequest; public static final long UPDATE_INTERVAL

Android FusedLocation's SettingsApi does not work more than once

喜夏-厌秋 提交于 2019-12-23 02:41:15
问题 FusedLocation has a wonderful API to check if the user has enabled all the relevant settings to obtain location. I followed the documentation https://developers.google.com/android/reference/com/google/android/gms/location/SettingsApi to fire up the SettingsApi. My code to check user's setting is as below private void checkLocationSetting() { if (mLocationSettingsRequest == null) { mLocationSettingsRequest = new LocationSettingsRequest.Builder() .addLocationRequest(mLocationRequest)

Unfortunately, MyApp has stopped - no error logs in logcat

蹲街弑〆低调 提交于 2019-12-22 04:35:06
问题 Every once in a while I get: Unfortunately, MyApp has stopped. Problem is easy to solve if you have some logs, but in my case logcat has absolutely no message of error (it has normal messages published by my app and other exceptions are shown there but not this one which causes this app has stopped ). Is there any chance I can solve this problem? The good thing is I can quite easily reproduce it, thus I'm trying to put as many information I can to logcat and then investigate what happened. I