I'd use a Service
with a Handler
inside. Using directly Thread
s is another approach but it's more likely it will be killed if the Android OS needs to free memory.
The Handler
part would be something like this:
boolean stopHandler = false;
Runnable runnable = new Runnable() {
@Override
public void run() {
// Do whatever you need
...
if (!stopHandler) {
handler.postDelayed(this, 600000); // 10 minutes
}
}
};