I am confused with android services and java thread.
Please help me to understand in which scenario i should use them.
As per my understanding
Why we need service is to avoid resource crunch.
For example you opening an application after opening an another application so at the time your app added to the background task.
While opening multiple application, ur app may killed by android system. So if ur app has service it won't be killed by the system because service is higher priority , even it may killed the app has service so that we using constant return type in onStartCommand()
. Method. That's START_STICKY,START_NOT_STICKY
and DELIVER_INTENT
.