2015-11-02 131 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