I need to perform the follow logic in my application: Every minute, I want to be able to listen to GPS location for 20 seconds to get a GEO-location fix.
This obviously needs to run a different thread than the UI thread.
I am however having some problems with using looper and timertask in conjuction...
What's the best way to achieve this?
I guess you need to use a Service :
Android doc :
So the Service start the LocationManager using requestLocationUpdates() and implements LocationListener.
Then you have (at least) two solutions (depending on what you want to do) :