Android Question [SOLVED] Administrator can't got working

gameone

Member
Licensed User
Hi i'm using administrator library here: https://www.b4x.com/android/forum/threads/device-administrator-library.19208/



So i put xml file (device_admin.xml) into Objects/res/xml of my project with this content:
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<limit-password />
<watch-login />
<reset-password />
<force-lock />
<wipe-data />
<expire-password />
<encrypted-storage />
<disable-camera />
<disable-keyguard-features />
</uses-policies>
</device-admin>



And in my manifest i have:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="8"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
AddApplicationText(<receiver android:name="anywheresoftware.b4a.objects.AdminManager$AdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<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>)
SetActivityAttribute(blackscreen,android:theme, @android:style/Theme.NoTitleBar.Fullscreen)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")





Under my main activity i put into process globals this:
Public manager As AdminManager




But nothing !!! Under emulator or real phone they don't ask for admin right ?
What i'm doing wrong ?


Thanks u
 

killiak

Member
Licensed User
Longtime User
Sure i forgot to call
Manage.enable("ask admin")

So apk wasnt asking for admin right.
A good old "[SOLVED] Will be awesome :D
 
Upvote 0
Top