覆盖或禁用设置菜单
我正在制作一个应在显示产品信息的商店中使用的应用程序。我使用 Android 平板电脑为客户提供一些交互式信息。用户不应该能够使用平板电脑执行任何其他操作。
到目前为止,我设法禁用后退和主页按钮。设备启动完成后,应用程序启动。因此,当他重新启动设备时,他无法启动任何其他应用程序(我无法阻止用户重新启动设备)。
问题是,客户可以打开设置菜单并强制终止我的应用程序。
有没有办法禁用设置菜单(例如通过使用密码保护它)或通过我的应用程序覆盖它?
我不打算将我的应用程序添加到 Android 市场,因为它只能在商店中运行。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了如何覆盖设置菜单。
由于设置菜单是通过隐式意图打开的,我只需要添加正确的意图过滤器我的活动:
这将让用户选择他想要打开的设置应用程序。如果我现在将活动设置为默认值,用户将无法通过状态栏访问设置菜单。
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:
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.
我很确定你不能一起禁用设置菜单。
您可以做的就是研究诸如删除状态栏(底部的状态栏)之类的事情。
查看类似:TabletBar Hider。我还没有测试过它,它还需要您找到一种让您的应用程序运行它的方法,或者一种将其实现到您的应用程序中的方法。如果您的应用程序启动后状态栏就被隐藏 - 我无法看到如何进入设置菜单。
您可以查看this关于全屏显示(但我不知道是否你已经尝试过/考虑过)。
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).