Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onStatusChanged situations

I have some doubts regarding onStatusChanged from LocationListener class.

It know it can present three states: AVAILABLE, TEMPORARILY_UNAVAILABLE and OUT_OF_SERVICE

  1. Does AVAILABLE gets triggered only when coming out of TEMPORARILY_UNAVAILABLE? Or when the GPS has just finished warming-up ? Or right before the first location update?

  2. How about OUT_OF_SERVICE, when does it get triggered? Right before onProviderDisabled ?

  3. Is it possible to simulate these events (statuses) with the emulator?

like image 930
AndroidDev Avatar asked Aug 17 '16 12:08

AndroidDev


1 Answers

According android source code explanation:

  • OUT_OF_SERVICE is returned if the provider is out of service, and this is not expected to change in the near future
  • TEMPORARILY_UNAVAILABLE is returned if the provider is temporarily unavailable but is expected to be available shortly
  • AVAILABLE is returned if the provider is currently available. If extras is non-null, additional status information may be added to it in the form of provider-specific key/value pairs.

LINK

like image 73
j2ko Avatar answered Nov 11 '22 22:11

j2ko