OnStatusChanged situations

I have some doubts regarding the onStatusChanged class from LocationListener .

He knows that he can represent three states: AVAILABLE , TEMPORARILY_UNAVAILABLE and OUT_OF_SERVICE

  • Is AVAILABLE executed only when exiting TEMPORARILY_UNAVAILABLE ? Or when the GPS just finished warming up? Or right before the first location update?

  • What about OUT_OF_SERVICE when it fires? Right before onProviderDisabled ?

  • Is it possible to simulate these events (statuses) using an emulator?

+8
android android gps
source share
1 answer

According to the explanation of the Android source code:

  • OUT_OF_SERVICE returned if the supplier fails, and this is unlikely to change in the near future.
  • TEMPORARILY_UNAVAILABLE returned if the supplier is temporarily unavailable, but is expected to be available soon
  • AVAILABLE returned if a provider is currently available. If extras is not null, additional status information can be added to it in the form of a provider key / value pair.

LINK

+1
source share

All Articles