I have seen the following question asked many times but none of the answers have been very clear, at least to me....
I want my android app to capture when GPS is enabled/disabled. I am NOT interested in the users current location, or in receiving location updates.
The reason I am confused is people have suggested both a location listener and the gpsstatus listener and I'm not sure how to work with either (I have looked at tutorials such as http://www.vogella.com/tutorials/AndroidLocationAPI/article.html and on androidhive etc.).
1)Do I implement the location listener within a service? If so, how is onProviderEnabled or onProviderDisabled called? Should the listener be created in onCreate(), onStartCommand() or does it matter?
2)Do I need to implement my service in conjunction with a broadcast receiver like you do for screen on/off events? Or can I capture the events with just a service...
3) If I don't care about location updates, do I still have to call locationManager.requestLocationUpdates in order for onProviderEnabled and onProviderDisabled to be called?
Edit: It needs to work on android api 8+