I am doing background process in my android application for that i used service.In iphone i use appdelegate for the background process.
My question is any other alternate methods to do the background process in andorid? If so which will be the best one?
Thanks.
To perform background process in Android you have 3 best options:
1) Thread
2) Service
3) ASYCN task
All these three are for the same purpose for which you are looking.
To stop Thread:
In general, you don’t forcibly stop threads because it’s dangerous. You set a flag that tells the thread in question to exit from it’s thread loop under controlled circumstances.
Your thread loop looks something along these lines:
How to Stop Thread: