-2

I'm facing the following problem. I want to make an android device to run only my application. All other apps and phone feautes should not be available to a user.

The reason why I want to achieve this is simple: I want to destribute devices with preinstalled application to my client but I don't want to let them use all phone featues.

This could work this way: just after android boots my application is launched automatically and than somehow all other staff is blocked.

Do you have any suggestions how to achieve that? Is it possible? Do I need to root a device?

I hope you get my problem. Any advice you can give will be greatly appreciated.

szakal
  • 87
  • 1
  • 1
  • 6

1 Answers1

1

This is a bit crude way. But see if it is of any help.

If you create your application as a launcher it will start on boot(using system broadcast BOOT_COMPLETED).

Then you need to override all the three android buttons Home, back and recent apps.

To override back button you just have to override the onBackPressed() method.

For home button you will start a service which will run in background. This service will check if your app is in foreground or not. if not then it will bring it in foreground. so when the user presses home the service will sense the foreground app isnt yours and launch it. But for this switching back of your app android takes approx 3 to 5sec. In that period of time you can display a warning text which will block the user from stopping the service from settings.Also if you remove the activity animations then it will appear seamless.

For recent apps button the above trick will do. If the user tries to close the app using this button your background service will sense it and launch your app. so its the background service that does all the trick. if you some how stop the service or uninstall the app you are through :p

Sirius
  • 113
  • 9