How do I make an application open-ended?

After the user opens my app, I don't want them to be able to exit. Therefore, when they press the home or back button, it prevents them from exiting the application. I know there are ways to use the service so that the app always runs in the background, but I don't even want them to even exit.

Is this possible, if so, how? Without having to crack the kernel.

I know it sounds strange, but this is not for a commercial application, but for my lab it will never be on GooglePlay. The pills will be given to young children and they will test it, so I cannot use them with YouTube or anything else.


Related post: Android how to make an application task open-ended? Only closes when killing a task

CommonWare's answer seems to indicate that kernel hacking is the only way, but this?

I also use the All Android of L .

+3


source to share


1 answer


there is no official support yet - there will be support from android L through the task blocking API

L Developer Preview introduces a new Task Lock API that allows you to temporarily prevent users from leaving the app or be interrupted by notifications. This can be used, for example, if you are developing an educational application to support the assessment of high Android requirement rates. When your app activates this mode, users won't be able to see notifications, access other apps, or return to the Home screen until your app exits mode.

https://developer.android.com/preview/api-overview.html



EDIT: as you said you are using L, this is deprecated, but I am leaving it here as a hint for others.

said that - you can also get this kind of work without root today if you need to (like a kiosk mode app on certain hardware). It's not easy - and there is no solution that works for all devices, but if you need it, you can get it to work with tricks like: - reacting to the home screen intent (and setting it as default) - when you go to the back plan - bring back your foreground plan again - ..

+3


source







All Articles