I am creating a app that would fetch data from a website every 2 minutes ..
I need to know whether I can go for a service ?
I tried using handlers and threads but it stops after 3 or 4 hrs I already tried using Async task but it’s not working out..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to use service because its always runs in background . Thread and AsyncTask and any other handlers not give guarantees to runs in background life time of applicatin.
Here you can find good tutorial for service.
http://marakana.com/forums/android/examples/60.html
http://saigeethamn.blogspot.com/2009/09/android-developer-tutorial-for_04.html
http://mylifewithandroid.blogspot.com/2008/02/double-life-of-service.html