0

My goal is to make my app unkillable.

  • Application has admin permissions granted.
  • I have one activity and one service.
  • Applionation cannot be uninstalled while Admin permission is active (thats good).
  • Service is auto re-creating. That's also correct.

Unfortunately on Android 5 - Lollipop user can click on all apps button - then go to Task Manager and simply END my app without any problems. After that service is destroyed for good (activity too obviously...)

Is this a way to prevent that?

Lau
  • 1,804
  • 1
  • 23
  • 49
  • Possible duplicate of [How can I prevent my Android app/service from being "killed" from a task manager?](http://stackoverflow.com/questions/2785843/how-can-i-prevent-my-android-app-service-from-being-killed-from-a-task-manager) – Ferrybig May 09 '16 at 12:32

2 Answers2

0

1) Xposed. At the cost of execution speed and dependency on the TaskManager that you will have to reverse-engineer a bit...

2) USER_PRESENT and friends. Your application can register a BroadcastReceiver and re-start on events. That is, it will be killable, but it will restart.

18446744073709551615
  • 16,368
  • 4
  • 94
  • 127
0

I think you are interested in something like a kiosk mode: displaying a single app and preventing to break out from it.

There are various tutorials out there. This one is quite good: http://www.andreas-schrade.de/2015/02/16/android-tutorial-how-to-create-a-kiosk-mode-in-android/

Edit: if your main target are Android 5.0+ devices you can also make use of screen pinning. http://developer.android.com/about/versions/android-5.0.html#Enterprise

J. Dow
  • 563
  • 3
  • 13
  • No, I'm not interested in kiosk mode. I just want to make prevent my service to be killed - Ending it from task manager prevent my service from being recreated.. – Lau Apr 14 '16 at 06:29