How to always run a service in the background
Posted
by Thomas H
on Stack Overflow
See other posts from Stack Overflow
or by Thomas H
Published on 2010-04-02T11:23:38Z
Indexed on
2010/04/02
12:23 UTC
Read the original article
Hit count: 344
android
Hi
I am in the process of creating an app that is similar to the build-in SMS app.
What I need:
- a service that is always running in the background
- every 5 min. the service checks the current location of the device and calls a web service
- if certain criteria are meet, the service should generate a notification (just like the SMS app)
- when the notification is clicked, the user is taken to the app (just like the SMS app)
- when the app is installed the service should be started
- when the device is rebooted, the service should be started
What I have tried:
- running a regular service which worked just fine until android kills the service
- using the AlarmManager the make the 5 min. interval call to a service. But I was not able to make this work.
Any help would be greatly appreciated...
-Thomas
© Stack Overflow or respective owner