2015-11-02 130 views
-2

我想创建一个应用程序,可以在未经用户许可的情况下自动进入Kiosk模式。我通过本教程在Android 4中实现了这一点:http://www.andreas-schrade.de/2015/02/16/android-tutorial-how-to-create-a-kiosk-mode-in-android/,但它不适用于Android 5.Android 5.0 kiosk模式

有没有可用于此的方法或库文件?

我需要为希望远程阻止设备的公司创建此项目。

+1

http://android.stackexchange.com/questions/85013/how-to一个植根设备这可能会帮助你-enable-task-locking-in-android-5-0-production-devices – VVB

+0

你可以通过以下链接查看进一步的指导http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/。 在Android活动中阻止开启/关闭电源禁用系统对话框。 – Ajay

回答

1

您可以将您的应用程序实现为启动器/主屏幕应用程序。

这是我知道通过按下Android 5及更高版本中的主页按钮来阻止用户关闭您的应用程序的唯一方法。

<activity 
    android:name="com.example.MainActivity" 
    android:label="@string/app_name" 
    android:launchMode="singleTask" 
    android:clearTaskOnLaunch="true" 
    android:stateNotNeeded="true"> 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     <category android:name="android.intent.category.HOME" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> 
</activity> 

一些详细信息:how-to-write-custom-launcher-app-in-android

否则,你将需要自定义ROM