如何建立软件限制用户操作一个单一的应用程序在Android? [英] How to build software limiting user action to one single App on Android?

查看:355
本文介绍了如何建立软件限制用户操作一个单一的应用程序在Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个应用程序的Andr​​oid和确保用户只能使用此应用程序。 (即用户不应该能够打开或安装任何其他应用程序。)

I want to build an app for android and ensure that the user can only use this app. (i.e. user should not be able to open or install any other app.)

是否有可能迫使Android设备上这样的限制?而如果是我应该在哪里开始呢?

Is it possible to force such restrictions on an Android device ? And if it is where should I start ?

推荐答案

你所寻找的被称为kiosk模式(只是为了帮助你在google搜索适当的术语)。

What you are looking for is called the "kiosk mode" (just to help you googling the appropriate term).

有在标准Android API,没有这样的事情(至少...尚未:看到编辑)。用户总是回来到主应用程序的能力,以preSS home键。

There is no such thing in the standard android api (at least... not yet : see the Edit). User always have the ability to press the home button to come back to the Home application.

但解决方案存在:


  1. 编写一个应用首页

这解决方案是有点弱(但可能满足您的要求?):制定一个家庭申请书(这是非常简单:只要把这样的事情在你的清单:

This solution is a little weak (but may fit your requirements ?) : develop a "Home application" (it's very easy : just put something like this in your manifest :

<activity android:name="MyCustomHome"
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.HOME"/>
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

这样,当用户preSS的home键:他将不得不选择在主页的应用程序来使用,如果用户决定让你的应用程序它的默认主页:他总是会回来给你的应用程序时, pressing的主页按钮。

With this, when the user press the home button : he will have to choose the Home app to use, and if the user decide to make your app it's default Home : he will always came back to your app when pressing the Home button.

缺点:Home键没有走出当前应用程序的唯一途径,所以这种解决方案不会真正阻止用户(如:三星,刷卡上下始终显示的工具栏..以及用户可以从那里做任何事情)

Drawback : the Home button is not the only way to get out of the current app, and so this solution won't really block the user (for instance : on samsung, swipe from top to bottom always display the toolbar... and the user can do anything from there)

使用特定构造的扩展:


  • 三星诺克斯是一个解决方案最近三星的设备(警告:它是企业庞大而复杂的安全解决方案:许多组件做很多事情,我想你需要一个合作伙伴三星获得存取权限亭模式API)

  • 摩托罗拉:有一个名为 EnterpriseHomeScreen 一个应用程序可以被用来运行自己的应用在信息亭模式

  • samsung-knox is a solution for recent samsung devices (warning : it's a huge and complex security solution for enterprises : many components to do many things and I think you need to be a samsung partner to get acces to kiosk-mode api)
  • for motorola : there is an app called EnterpriseHomeScreen that can be used to run your own app in kiosk-mode

我想其他的解决方案存在其他的构造,但我不知道他们。

I guess other solutions exists for other constructors, but I'm not aware of them.

修改/更新

使用Android的5.0棒棒糖:在固定屏幕API 让你在的信息亭模式。为Android术语的信息亭模式的是屏幕钉住模式的。

With Android-5.0-Lollipop : the screen pinning api allows you to run your app in kiosk-mode. The android terminology for kiosk-mode is screen-pinning-mode.

为了让你的应用程序中工作的屏幕钉住模式的,你必须使用的 Activity.startLockTask (和的 Activity.stopLockTask()退出屏幕牵制模式)。

To make your app working in screen-pinning-mode, you must use Activity.startLockTask (and Activity.stopLockTask() to quit the screen-pinning mode).

默认情况下,用户必须批准屏幕钉住模式(弹出时会提示您的应用程序调用 startLockTask )。

By default the user must approve the screen-pinning-mode (a popup will be prompted when your app call startLockTask).

如果您的应用程序是一个设备所有者:那么用户将不会提示和你能去的屏幕钉住模式的无需确认。

If your app is a device owner : then the user won't be prompted and your can go in screen-pinning-mode without confirmation.

用户还可以启用的屏幕钉住模式的一个应用程序手动选择:设置>安全>固定屏幕的。 (在这种情况下:用户可以通过同时持有的后退和近期按钮退出屏幕钉扎模式)

The user can also enable screen-pinning-mode for an app manually by choosing : Settings > Security > Screen Pinning. (in this case: the user can exit screen-pinning-mode by holding both the Back and Recent buttons)

这篇关于如何建立软件限制用户操作一个单一的应用程序在Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆