Don't let user leave my app

1.1k views Asked by At

I'm developing and app that is going to be installed on a tablet. I'm going to rent this tablet to a person and I don't want this person to leave my application, I mean, I only want that tablet to use my app. I don't want the person to have access to other applications that it's not my app, even if the tablet is turned off, when restarted I would like my app to start first.
I've tried to change home button and so on, but it's not possible.
Can anybody give me a hint? I would appreciate any help

1

There are 1 answers

1
user1990950 On
  1. Make your activity full screen.

2 Use an alarmManager to trigger your activity from a service on a regular interval say 2or3 second (only if your activity is not foreground). For this use a boolean variable and store it using sharedPreference. this value will be true in onReume and false in onPause or in onStop or in onDestroy. And then only start your activity from your service if the boolean variable is false. Now if your user will press the Home button then AlaramManager kick start your activiy again.

3 Make a special button for finishing your service and activity and for cancel the alarmManager.

I found this answer on this post:

It is possible to make a HoneyComb activity unclosable?