If you see gps icon in status bar all the time then it means GPS is on and used, you can do it programmatically by
removeUpdates
a)Locking is done automatically by device and Android OS.
b)Sensing means if you are talking about location information then it is done by
requestLocationUpdates()
. However information about GPS and its status is done by GPSstatusListener
Android GPS locking and sensing
Question
I wrote an Android GPS application, that requests a location update every 20 seconds using GPS as the provider. I also added a GPS status listener to monitor the available satellites and their SNR.
I noticed that the GPSstatuslistener
remains updating the satellites' information all the time (i.e. not every 20 seconds)!
My questions are:
- Does this mean that the GPS sensor is always on or does it sleep between every 20 second interval?
- The GPS location invocation consists of two stages a) locking, and b) sensing/reporting. In the android does the
GPSstatuslistener
do the locking and therequestLocationUpdate
do the sensing?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow