The last time this question was asked (by a different user), the answer response was:
If this is in a running activity, you could use Timer/TimerTask
If you want to build a cronjob runner then what you want is a Service:
A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Another application component can start a service and it will continue to run in the background even if the user switches to another application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background.