If you want to call that API after 30 second again and again
use Service with Broadcast receiver.
Service will do your Task in Background but will not provide any UI so you need to register with Broadcast receiver.
use Service with Broadcast receiver.
Service will do your Task in Background but will not provide any UI so you need to register with Broadcast receiver.
Check this Sample , this sample show how to repeat a task and update UI using Service and Broadcast receiver.
Also refer this tutorial for further reference.