Android:如何使设备仅运行一个应用程序? [英] Android: How to make device run only one app?

查看:572
本文介绍了Android:如何使设备仅运行一个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户项目,在这里我必须制作单个任务的android设备.客户无法摆脱我公司开发的应用程序.另外,客户无法启动任何其他应用程序,并且在启动设备时启动了我们的应用程序.总体而言,所有客户能够使用该设备执行的操作都是运行我们的应用程序.

I have an customer project where I have to make single task android device. Customer isn't able to escape the application which my company have developed. Also customer isn't able to start any other application and our application is started when the device is booted. Overall all the customer is able to do with the device is run our application.

除了使设备根目录,禁用所有系统按钮并使我们的应用程序成为启动程序之外,还有其他方法可以实现此目的.我有大约400个设备用于此目的,因此将所有这些设备扎根将花费大量时间.

Is there any other way to make this work than rooting the device, disabling all system buttons and making our application the launcher. I have something like 400 devices for this purpose so rooting all those would cost lot of time.

我还阅读了Google关于COSU设备的教程,但发现它非常令人困惑 https://developer.android.com/work/cosu.html#testing-plan

I also read Google's tutorial about COSU devices but found it very confucing https://developer.android.com/work/cosu.html#testing-plan

Android自己的屏幕固定效果还不够好,因为客户可以逃脱该应用程序.有些人可能建议使用诸如SureLock之类的自助服务终端应用程序,但是我公司的目标是为此找到一种清晰的解决方案,而无需使用任何第三方应用程序.通过某些信息亭应用程序运行我们的应用程序也不是我们的目标.

Androids own screen pinning is not good enough because customer can escape the app. Some may suggest to use some kiosk application like SureLock but my company's goal is to find clear solution for this without using any third party apps. Also running our app via some kiosk application is not our goal.

我在Stack Overflow上找到了一些类似的问题,但找不到我想要的答案.

I found some posts on the Stack Overflow with similar question, but not the answer I'm looking for.

如果有人对这个问题有一些提示,我将非常感谢.

If someone has some tips for this question I would be very grateful.

推荐答案

基于Android的单用途设备可能难以实现.有几种不同的选择,但是每种选择都有权衡取舍.

Single purpose devices built on top of Android can get difficult to implement. There are a few different options, but each have trade-offs.

正如您所提到的,生根设备将在功能上满足您的需求-但是,要生根数百个设备将非常耗时,难以维护,并且(可能)会给设备和应用程序带来安全性问题.

As you mentioned, rooting devices will functionally get you what you want - however it will be time consuming with hundreds of devices to root, difficult to maintain, and you will (potentially) introduce security issues to your devices and app.

另一种选择是对COSU设备使用Google的锁定任务模式.那里的链接有一个漂亮的图形,显示了锁定任务模式的功能:

Another option is using Google's Lock Task Mode for COSU devices[1]. The link there has a nice graphic showing the features of lock task mode:

  • 1个应用固定在主屏幕上
  • 只有被DPC(设备策略控制器)列入白名单的应用可以被锁定
  • 隐藏了主页"和最近使用"按钮
  • 通过调用stopLockTask()
  • 退出
  • 1 app pinned to the home screen
  • only apps white-listed by the DPC (device policy controller) can be locked
  • Home and Recent buttons hidden
  • exit by calling stopLockTask()

为此使用Google解决方案有一些弊端.首先,Google建议创建(并维护)一个完全独立的DPC应用程序,使其作为设备所有者运行并设置策略[2].您还必须依靠Google Play来管理应用程序更新,并且需要具有与每个设备相关联的Play帐户,这些帐户用于标识与单个用户无关的单个设备,从而简化了按设备分配应用程序的规则在COSU风格的场景中" [3].要在设备上自动获取DPC应用,您需要"DPC必须在Google Play上公开可用,并且最终用户可以通过输入DPC专用标识符从设备设置向导安装DPC." [3]您还需要将用户应用程序上传到Google Play [4],这对于某些不想在Play上使用其应用程序的人来说可能是个问题.遵循此路线可以为您提供所需的功能,但可能会很复杂,并且还会使您和您的客户与Google/Play服务及其工作流程紧密地联系在一起.

There are some downsides to using Google's solution for this. First Google recommends creating (and therefor maintaining) an entirely separate DPC app to run as a device owner and set policies[2]. You'll also be dependent on Google Play to manage application updates and be required to have Play accounts associated with each device which "are used to identify a single device that is not tied to a single user for simplified, per-device app distribution rules in COSU-style scenarios"[3]. To automatically get your DPC app on devices your "DPC must be publicly availble on Google Play, and the end user can install the DPC from the device setup wizard by entering the DPC-specific identifier."[3] You'll also need to upload the user application to Google Play[4], which may be an issue for some who don't want their apps on Play. Going this route gives you features you need, but can be complicated and also ties you and your customer pretty tightly with Google/Play services and their workflow.

您还可以查看诸如Mason [5]之类的企业移动部署平台.对于您自己的情况,您可以在几分钟内创建一个自定义Android操作系统,并将您的应用锁定在信息亭模式(以及其他功能,例如禁用相机/短信,删除应用和隐藏设置等),然后将其部署到所有设备上远程地.如果您的需求发生变化,Mason还支持由您控制的操作系统和应用程序更新.

You can also look at enterprise mobile deployment platforms like Mason[5]. In your case, you can create a custom Android OS in a few minutes with your app locked in kiosk mode (+ other features like disable camera/sms, remove apps and hide settings, etc.) and then deploy it to all of your devices remotely. Mason also supports OS and app updates controlled by you if your requirements change.

如果这听起来有用,请随时与我联系:trevor @ bymason.com

If this sounds useful, feel free to reach out to me: trevor @ bymason.com

免责声明:我为梅森工作

  • [1] https://developer.android.com/work/cosu.html
  • [2] https://developer.android.com/work/cosu.html#create-dpc
  • [3] https://developers.google.com/android/work/requirements/cosu
  • [4] https://developers.google.com/android/work/play/emm-api/samples#push_install_an_app_on_a_device
  • [5] https://bymason.com/

这篇关于Android:如何使设备仅运行一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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