I am using MapView to show current location of a user on a Map. To update the location while the user is on the move, I have to a choice:
- I can use MyLocationOverlay to draw the current location and extend it to allow tracking of the users location on the move and to have custom marker. The problem with MyLocationOverlay is that I cannot control the frequency with which the device requests the location from GPS. I am worried about the battery drain here.
- I can use Location Manager and subscribe using requestLocationUpdates to get location from GPS. Here I have more control over the frequency with which the GPS is queried. I can hook up a LocationListener and write the code in there.
But I have read here at SO that it might not be good approach to use Location Manager and MyLocationOverlay should be preferred over to this.
Also, consider that my app is a location based app the location of the user should be tracked as he moves.
Can people suggest which is the best approach to implement and has relatively less impact on battery.
Note that I am a beginner in Android, so pardon any obvious mistakes.
Thank you in advance, andy