0

I am trying to set up a monitoring functionality on an Android device. I would like to monitor the actual usage of the GPS sensor on the phone. This means I am primarily not interested in when the user turns the GPS sensor on/off, but when he uses GPS data through any given app (e.g. maps, location based search).

I have tried the approach mentioned in Get GPS start/stop events with addGpsStatusListener, however, unsuccessfully.

It is also unclear to me whether GPS_EVENT_STARTED means a resume from standby of the sensor, or simply reflects toggling the "allow GPS" in the settings by the user. (see: http://developer.android.com/reference/android/location/GpsStatus.Listener.html)



Would someone know:

a) whether such a functionality is implementable/has already been implemented

b) how this could be accomplished?


Many Thanks.

Community
  • 1
  • 1
Karl Hardr
  • 101
  • 4

1 Answers1

0

After excessive testing of several approaches (a selection):
How can I enable or disable the GPS programmatically on Android?
Android Enable and Disable GPS
How to programmatically enable GPS in Android Cupcake
How to enable GPS in android coding

I found that on Android v4.2.2 it was indeed not possible to toggle the GPS status (regardless of what exactly the status implies, as also asked in my question). I particularly found a comment in question How can I enable or disable the GPS programmatically on Android? to be misleading. Even if the exploit with the power control widget should have reemerged in 4.2.2, it has since been fixed.

Community
  • 1
  • 1
Karl Hardr
  • 101
  • 4