views:

478

answers:

2

It is very important that my service stay running until someone with a password stops the service from my UI screen. My app runs great but it is designed to be turned on/off by parents (with a password) on their kids phones. I have managed to make everything work but the problem I'm having is that if the kid uses a task manager to kill my service then my app is useless. I would be grateful to anyone who knows a way to either

1) monitor the service and start it back up automatically if its "killed" or 2) prevent someone from being able to kill it except from the activity (administration screen) that launched the service. Or both?

I'm sorry if I'm not very clear in describing the problem, I'm a beginner. I've made great progress so far but I am stuck at this last hurdle.

+1  A: 

There isn't a way to prevent this directly, without a rooted device. The SDK helpfully prevents these kinds of issues.

You can do the "truly evil" trick and have two services in two application. Each service monitors the other, and restarts it if it stops. This is kludgy, but in most cases even the fastest fingered kid couldn't kill both applications.

Yann Ramin
But a program can! Any program that can execute the equivalent of `kill -KILL -1` can cause all your instances to die simultaneously.
Chris Jester-Young
A: 

hi your problem has been solved by me i have a program that nothing can close it and it can watch your application and when something closes it my program will restart it agane all you have to do is send me yor application process name(the one that apear in task maneger) and your application path (like c:\windows\myapp.exe) [email protected] have fun

mohammad fatemi
You missed the tag "android".
laura