android-fusedlocation

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

How to receive location updates every 5 minutes using the FusedLocation API

烂漫一生 提交于 2019-12-03 09:00:23
I am currently working on an app that has to check the user's location every five minutes and send the coordinates to a server. I decided to go with the FusedLocation API in Google Play Services instead of the plain old LocationManager API, mainly because I noticed the LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY priority level, which claims to offer a 100-meter accuracy level with reasonable battery usage, which is EXACTLY what I need. In my case, I have an Activity whose inheritance structure is: public class MainActivity extends AppCompatActivity implements GoogleApiClient

How can location updates from FusedLocationProviderClient be processed with Work Manager?

这一生的挚爱 提交于 2019-11-28 12:36:49
First of all, I'm a total Android noob. Have looked for solutions for some time now, but can't find any helpful hints in the right direction so far. This might be generally caused by the nature of the issue itself, being quite niche. The working code below is based on a code lab at https://codelabs.developers.google.com/codelabs/realtime-asset-tracking . I was wondering though, since it was mentioned within several resources as the preferred way now, how you'd do something like that based on Android's Work Manager instead of a Service with an ongoing notification? public class TrackerService

FusedLocationApi Performance Issue: Accuracy seems capped at 10.0 meters

两盒软妹~` 提交于 2019-11-28 11:44:30
I'm experiencing a strange problem where the FusedLocationProviderAPI does not give me a better Accuracy number then 10.0 meters. It starts like normal giving me a high number of, for example, 56 meters... 24... 13... and then stays at 10.0. Seemingly capped at giving no better then that. Tried on Phone Sony Xperia Z2 & Huawei Honor 8 location.getAccuracy() //Seems capped at 10.0 meters The strange part is that I was receiving an Accuracy number down to around 3.0 meters with good weather outside and I have no memory of changing the phones GPS options / nor any options related to the GPS

FusedLocationApi.getLastLocation is always null, even onCreated()

前提是你 提交于 2019-11-28 02:15:15
I'm asking about receiving FINE and COARSE permissions successfully. Then building GoogleAPIClient and creating LocationRequest but then FusedLocationApi.getLastLocation it keeps on returning null. I am aware that the connection should be established before asking for a location. Because onStart() where the Connection is established is called after retrieveLocation() method I call mLocationApiClient.connect() immediately after building GoogleApiClient. onConnected method is being hit and when I check mLocationApiClient.isConnected() it says 'true'. And then when I try to retrieve LastLocation

How to get current Location in GoogleMap using FusedLocationProviderClient

自作多情 提交于 2019-11-27 11:08:50
I want to get periodic (say every 2 minutes) current location updates for this I'm following official documentation, I wrote this code but its not giving current location updates every two minutes even specified in LocationRequest object that I'm passing in requestLocationUpdates(), here is code: public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{ private FusedLocationProviderClient FusedLocationClient; private GoogleApiClient mGoogleApiClient; @Override protected void onCreate(Bundle

Why is FusedLocationApi.getLastLocation null

纵饮孤独 提交于 2019-11-27 07:34:33
I am trying to get location by using FusedLocationApi.getLastLocation and I've got the location permissions in the manifest file: <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> However, I am getting null when I request the location from the system. I was just testing turning off and on location services so it may be related to that (of course, it's ON when I'm trying this). But even after returning null, I'm waiting for onLocationChanged to be called and it's never called. I've also seen a