Ive been working on this for quite some time but can't seem to find a solution.
I have an android tablet that is intended for use in a proprietary application. We need to lock down the tablet so it can only run the app(and select few others). Im aware of "Kiosk" mode but I need the user to still have access to the back and home buttons(home goes back to our app)
Primarily the reason I need the user to still have access to the back and home buttons is so they can get back to my app after launching say... wifi settings.
My application has a thread that is always running even when not in the foreground for data handling and such. So my first idea was... lets detect what application is in the foreground and if it isn't my application or a small list of allowed(like wifi settings) then kill the app and bring my app to the foreground. But no matter what I try it doesn't seem to work...
First I tried to just simulate the home button(my app is linked to the home button) This doesn't work once my app is the only home button option.
Ive tried using android.os.Process.killProcess to kill any application that is in the foreground... this only works with very few apps.
Ive also tried re-launching the app using an intent but that doesn't work either.
I understand that this is mostly due to the android system trying to keep malicious apps from taking control of the device, this app will not be distributed on any market.