I'm developing application that should update users current location on few minute interval.
Existing built-in timeInterval option on LocationManager.requestLocationUpdates method is not reliable.
I found few solutions that solve the problem by using timer and manual control of requestLocationUpdates interval.
Is there some other solution or using timer is the best option?
Yes, the LocationManager takes time interval just as a hint. If you want more precise timing, I'd look into manually requesting updates when needed (plus that helps save battery). You can use AlarmService to set the intervals.
Still haven't tried to do it with AlarmService, but I've found some snippet that is using Handler to initiate scheduled task.
I had problem to update map when using Timer because it's not allowing to access UI from non UI thread (ERROR: Can't create handler inside thread that has not called Looper.prepare()).
Now I've created something like this in onCreate
In location listener I call removeUpdates inside onLocationChanged to stop GPS updating after retrieving location.
Now it's requesting location every 20sec (and move the marker across the map)
Is this approach good, or it has some hidden issues?
You cannot update UI thread from a non-UI thread. That's why you are getting that problem. Take a look at AsyncTask - it was designed specifically to get around this problem. It simply synchronizes threads over UI components.
I used to use Handler to post delayed messages and have something repeat over and over again that way. It works, but it's not as elegant as AlarmService.
I addressed all these issues in the book. Hopefully it helps you.