I am looking for what service should be used in android applicaton.
A Service is an application component that can perform long-running operations in the background and does not provide a user interface.
A Service is meant to run your task independently of the
Activity, it allows you to run any task in background. This run on the main UI thread so when you want to perform any network or heavy load operation then you have to use the
Example : Suppose you want to take backup of your instant messages daily in the background then here you would use the
Threads is for run your task in its own thread instead of main UI thread. You would use when you want to do some heavy network operation like sending bytes to the server continuously, and it is associated with the Android components. When your component destroy who started this then you should have stop it also.
Example : You are using the
Thread in the Activity for some purpose, it is good practice to stop it when your activity destroy.