如何使用Android-L preVIEW任务锁定? [英] How to use Android-L preview Task Locking?
问题描述
有没有人有任务锁定在Android中l工作?他们能分享它是如何工作的一些细节?我看到下面的说明,但努力理解这一点。
Has anyone got task locking working in Android L? Could they share some details on how it works? I have seen the instructions below, but struggling to understand this.
目前,我已经做了应用程序,我想在Kiosk模式下运行。我已经看过使其成为一个启动应用程序,或使用型Surelock但新的任务锁定看起来这将是未来的最佳选择。
At the moment I have made an App that I would like to run in kiosk mode. I have looked at making it a launcher App or using Surelock but the new task locking looks like it will be the best option in future.
我需要创建的Android L的userdebug构建?我还没有建立的Android从源之前,我就开始寻找使构建,但我不认为源代码的Android-L提供了吗?
I need to create a userdebug build of Android L? I have not built Android from source before, I started looking at making a build but I don't think the source for Android-L is available yet?
To set up a device owner, follow these steps:
Attach a device running an Android userdebug build to your development machine.
Install your device owner app.
Create a device_owner.xml file and save it to the /data/system directory on the device.
$ adb root
$ adb shell stop
$ rm /tmp/device_owner.xml
$ echo "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>">> /tmp/device_owner.xml
$ echo "<device-owner package=\"<your_device_owner_package>\"name=\"*<your_organization_name>\" />" >> /tmp/device_owner.xml
$ adb push /tmp/device_owner.xml /data/system/device_owner.xml
$ adb reboot
https://developer.android.com/$p$pview/ API-overview.html
编辑:更多资讯
我想铲除我的设备(的Nexus 7),运行Android-L preVIEW。然后我把device_owner.xml在数据/系统/我的包名。但它仍然无法正常工作,islockTaskPermited()返回false,并调用startLockTask()什么都不做。
I tried rooting my device (Nexus 7) running the Android-L preview. I then put a device_owner.xml with my package name in data/system/. But it still does not work, islockTaskPermited() return false, and calling startLockTask() does nothing.
推荐答案
以下面剪断从的任务锁定API
显然,startLockTask()API将高压影响,如果device_owner.xml是present。
It is clear that startLockTask() api will be hv effect if device_owner.xml is present .
如何检查,如果我的应用是设备拥有者?的
How do i check if my app is device owner ?
当你的应用程序是设备拥有者,你的应用程序是设备管理器选项将被检查,复选框,将灰色的了,因此不会允许ü取消选中该复选框。
When you app is device owner , you app is Device Administrator option will be checked and checkbox will be gray out hence will not allow u to untick the checkbox.
您需要给系统正确的一边推device_owner.xml
You need to give system right while pushing device_owner.xml
按照以下步骤操作:
- 创建device_owner.xml [确保该应用程序将是presentü前 推device_owner.xml]
- 导航到终端的路径在哪里device_owner为present
- 在亚洲开发银行推device_owner.xml / SD卡/
- 亚行外壳
- 苏
- 在CP /sdcard/device_owner.xml /数据/系统/
- 在CD /数据/系统/
- CHOWN系统:系统device_owner.xml
- 重启
- Create device_owner.xml [make sure the app will be present before u push device_owner.xml ]
- Navigate to path in terminal where device_owner is present
- adb push device_owner.xml /sdcard/
- adb shell
- su
- cp /sdcard/device_owner.xml /data/system/
- cd /data/system/
- chown system:system device_owner.xml
- reboot
这篇关于如何使用Android-L preVIEW任务锁定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!