Fused Location GPS does not update until Google Maps opens

I use a paid location provider in my application, which is installed on PRIORITY_HIGH_ACCURACYwith an interval of 60 seconds. This usually works, but sometimes the location does not update within 5-10 minutes, and when I open Google Maps, it seems to start updating the location.

Anyone else who might run into this problem or know the possible reasons for this behavior? Is there any way to fix this?

+6
source share
2 answers

Gps , FusedLocationProvider api LocationManager LocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER). , , Gps Gps. Gps , .

, LocationManager Gps, Wifi GpsStatusListener, , FusedLocationProvider , Location.getExtras() FLP, . LocationManager Gps , - 2, Gps.

Hello World Gps, , . GManManager Gps Health Status Test , , , , , 3 Gps . Gps, GpsStatusListener GpsStatus.GPS_EVENT_FIRST_FIX, . 5 , Gps . , , Gps LocationManager, FLP.

0

, Fused Location Provider , . , . , getLastLocation() onConnected(), . , null.

, (), , getLastLocation(), .

() - com.google.android.gms.location.LocationListener ( ).

0

Source: https://habr.com/ru/post/1014162/


All Articles