I'm re-inventing the wheel here, but as I'm a beginner programmer I'm curious as to the best way to do this...
As part of an Android app, I'm developing a very simple media player. It plays the file, and I want a m:s timer, so the user can see how far into the file they are (e.g. "04:56"). I'm probably missing the obvious, but what's the best way to do this?
One way would be to generate a new thread which sleeps for 1000ms, then calls MediaPlayer.getCurrentPosition() and updates the UI. However, this seems slightly ridiculous - my thread isn't guaranteed to come back every second, so I'm going to be displaying an inaccurate time. There must be a better way of doing this?
Educate me (or link for me).