How do I get my app to start updating GPS location as soon as I open it?
Right now I have this code:
locationManager.requestLocationUpdates(bestProvider,0 ,0, loc_listener);
location = locationManager.getLastKnownLocation (bestProvider);
Which takes the best location. I ran my app on my phone and it got the location from where I was earlier today.
I want my app to update the gps location when I first open it.
I have been looking at these threads:
What is the simplest and most robust way to get the user's current location on Android? Android find GPS location once, show loading dialog
But I am having trouble wiring everything up.