Hello,
I am trying to run the Device Administrator library example project, but I am encountering the following error:
How can I resolve this issue? Any guidance or solutions would be greatly appreciated.
Thank you!
B4A version: 13
Device : Samsung Galaxy Tab S5E (SM-T720)
Example File
Manifest
I am trying to run the Device Administrator library example project, but I am encountering the following error:
B4X:
java.lang.SecurityException: No active admin owned by uid 10315 for policy #0
How can I resolve this issue? Any guidance or solutions would be greatly appreciated.
Thank you!
B4A version: 13
Device : Samsung Galaxy Tab S5E (SM-T720)
Example File
Manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddApplicationText(<receiver android:name="anywheresoftware.b4a.objects.AdminReceiver2"
android:permission="android.permission.BIND_DEVICE_ADMIN"
android:exported="true"
>
<meta-data android:name="android.app.device_admin"
android:resource="@xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>)
CreateResource(xml, device_admin.xml,
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<limit-password />
<reset-password />
<force-lock />
</uses-policies>
</device-admin>
)