Can you explain to me:
What is the need or advantages of services in Android over multithreading?
Benefits of Services
over multithreading:
Activity
to run.Services
can be invoked through intents
.Some pitfalls:
stopSelf()
after you have finished your work.If you want to execute a long operation and do not want to interrupt it, you should use services. By using multi-threading operating system can kill your application easily, but if you register for a service, then it will wait for finishing that operation.
To sum up, you should use a service for critical operations like uploading photo, and you can use multi-threading where interrupting the operation is not critical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With