14

I'm making an application that should be used in a store that displays product information. I use an Android tablet to provide the customer with some interactive information. The user should not be able to do anything else with the tablet.

So far i managed to disable the back and home button. The application starts when the booting of the device has finished. He can therefore not start any other application when he restarts the device (I was not able to prevent the user from restarting the device).

The problem is, that the customer can open the settings menu and force kill my application.

Is there a way to either disable the settings menu (e.g. by protecting it with a password) or to override it by my application?

I do not plan to add my application to the Android market since it should only run in the stores.

js-
  • 1,632
  • 1
  • 14
  • 18

2 Answers2

25

I found out how to override the settings menu.

Since the settings menu is opened via an implicit Intent I just need to add the right intent filters my activity:

<intent-filter >
    <action android:name="android.settings.SETTINGS" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter >
    <action android:name="android.settings.WIRELESS_SETTINGS" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

This will let the user chose the settings application he wants to open. If I now set my activity as default, the user can not access the settings menu via the status bar.

js-
  • 1,632
  • 1
  • 14
  • 18
  • Worked great on my Lenovo YT3-850F, Lollipop 5.1.1. – Storo Sep 09 '16 at 13:13
  • its. just. awesome. – P. Savrov Mar 30 '17 at 14:26
  • 1
    @js- I'm trying to create a custom launcher for my device and want to remove the ability to change the launcher, except by an administrator. Is there a way to programatically remove the HOME setting from the Settings application? Or remove the ability to access the Settings application all together? I don't want the user to be able to switch back to the default Android launcher. – Wayne Johnson Apr 07 '17 at 14:55
  • @wayne-johnson You can override HOME setting permanently using DevicePolicyManager.addPersistentPreferredActivity. Check android cookbooks for example https://developer.android.com/work/dpc/dedicated-devices/cookbook Your app has to be set as device owner for this to work. – mzmrk Jul 31 '20 at 11:38
0

I'm pretty sure you can't disable the settings menu all together.

What you could do is look into something like removing the status bar (the one at the bottom).

Check out something like: TabletBar Hider. I haven't tested it, and it would also require that you find a way of having your app run this or a way to implement it into your app. If the status bar gets hidden as soon as your app boots - I can't see how one would get into the settings menu.

You could look into this about getting fullscreen (but I don't know if you've allready tried/considered that).

Community
  • 1
  • 1
kaspermoerch
  • 16,127
  • 4
  • 44
  • 67
  • Rooting the devices is not an option. I know how to disable the status bar manually via killing systemUi but for the daily use it is too complicated and must be done after each start of the device. Then I have the problem that the customer can restart the device which I cannot suppress. – js- Nov 22 '11 at 10:33
  • Your second link for getiing fullscreen works only for Android Version < 3.0. Since I use tablets which have Android 3.2 this does not work. – js- Nov 22 '11 at 10:45