tags:

views:

92

answers:

1

Hi, ive read this article by Mark Murphy, while i was looking for a solution to my case.

I have a Listener in my system, which suppose to get a UDP trigger times to times from an outside server, ive done this listener as a service.

how could i prevent it being shut off by the user? (SDK 1.5), i`am working for a company which create cell phones, and we spread the device with this Listener.

as soon as the listener goes off our systems will be terminated

any idea for this scenario?

*i`am already aware to the face, that the system could also take it off, but this case will be easier to handle and avoid.

thanks,

ray.

+3  A: 

how could i prevent it being shut off by the user?

You can't, at least not as an SDK application.

i`am working for a company which create cell phones, and we spread the device with this Listener.

Reimplement it as part of the firmware, perhaps in C/C++. That cannot be shut off by the user.

CommonsWare
Yes, but couldnt i register my app with the AlarmManager so it will be wake up after once in a while, so even if the user shut the app/service off off, it will be fired up again by the alarmManager again?(which was registerd before)
rayman
That works, but only if the user stops your service via the Settings application. If they use a so-called "task killer", that will wipe out your alarms as well.
CommonsWare
We gonna spread our phones with SDK 1.5, and i cant find there the "Settings application", is it exists there? and if not, the Alaram-manager trick might just work, wouldnt it?
rayman
After ive checked, we cant reimplement the phone firmware.. it's too late for that! could you think on other ideas, how to prevent or even make it harder on the user to kill our Listener? the thing is that the user pays for our services, we want to prevent a mistakes (of the user or any other app) which might take down our Listener-service.
rayman
The "Manage services" option in the Settings application did not show up until Android 1.6 or 2.0. The Settings application itself has been around since before Android 1.0, and it has to be in your firmware. "how to prevent or even make it harder on the user to kill our Listener?" -- there is nothing much you can do about that.
CommonsWare
So as soon as i remove the app from the "settings application" in a magical way its unregister itself from the alarmanager(in case it was registerd before)... didnt expect that, but okie.. thanks!
rayman