Answer the question
In order to leave comments, you need to log in
Where should I put my AdminManager.java in a QT project?
Hi all. Trying to make a kiosk mode app for android 5.1 using QT 5.9.9
AndroidManifest.xml
<?xml version="1.0"?>
<manifest package="inc.garage.ncf05m" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.1" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
<receiver android:name=".AdminManager" android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin" android:resource="@xml/policies" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTask">
<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>
<intent-filter>
<action android:name="android.settings.SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
.....
<device-admin>
</device-admin>
package inc.garage.nfc05m;
import android.app.admin.DeviceAdminReceiver;
public class AdminManager extends DeviceAdminReceiver{
}
$adb shell dpm set-device-owner inc.garage.ncf05m/.AdminManager
Success: Device owner set to package inc.garage.ncf05m
Active admin set to component {inc.garage.ncf05m/inc.garage.ncf05m.AdminManager}
LOGCAT: E/AndroidRuntime( 2110): FATAL EXCEPTION: main
LOGCAT: E/AndroidRuntime( 2110): Process: inc.garage.ncf05m, PID: 2110
LOGCAT: E/AndroidRuntime( 2110): java.lang.RuntimeException: Unable to instantiate receiver inc.garage.ncf05m.AdminManager: java.lang.ClassNotFoundException: Didn't find class "inc.garage.ncf05m.AdminManager" on path: DexPathList
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question