Questions tagged [device-admin]

The Device Administration API for Android 2.2 and later allows applications to enforce security policies by requiring a password or encryption, and to lock or wipe the device programmatically.

Android 2.2 introduces support for enterprise applications by offering the Android Device Administration API. Administrators can enforce password policies — including alphanumeric passwords or numeric PINs — across devices. Administrators can also remotely wipe (that is, restore factory defaults on) lost or stolen handsets.

226 questions
93
votes
8 answers

How to remove an app with active device admin enabled on Android?

I wrote an app with device admin enabled (DevicePolicyManager) and installed. But when I want to uninstall it, it returns failed with this message WARN/PackageManager(69): Not removing package com.mypackage.test: has active device admin How can I…
shiami
  • 7,174
  • 16
  • 53
  • 68
70
votes
5 answers

How to make my app a device owner?

The device policy manager API docs and the android 5.0 overview both mention something about a device owner app. How can I setup my app as a device owner? Edit: Is there any other ways than rooting and NFC if available please share.
Vishal Santharam
  • 1,963
  • 1
  • 16
  • 30
58
votes
8 answers

Firebase message with high priority not waking device from Doze android 6+

I have migrated my project from using GCM to use Firebase. Push notification comes through ok when the device is awake or been asleep recently but if I leave the device for say an hour, no push is sent until I wakeup the device. The Android docs say…
turtleboy
  • 8,210
  • 27
  • 100
  • 199
45
votes
5 answers

Getting 'No active admin' SecurityException in Android 10 - how to resolve?

I am encountering an error in the pre-launch report on the Google Play Console during testing. The error message is as follows: java.lang.SecurityException: No active admin…
25
votes
4 answers

Lock the Android device programmatically

I have been trying to lock the device through program. But I can't find the solution still. I want to lock Android froyo2.2 through program. I have tried keyguardmanager and DeviceAdminManager. My app is to remote lock the device. When message is…
adithi
  • 973
  • 3
  • 11
  • 19
15
votes
3 answers

how to make my application device administrator in android?

I am trying to make my application device administrator , i followed some notes provided on the same at Device admin SAMPLE notes or TUTORIAL here but still could not implement it. Can some one plz point out a working example of the same , i just…
rolling.stones
  • 496
  • 3
  • 9
  • 20
12
votes
2 answers

DevicePolicyManager.lockNow(); doesn't turn off screen when security settings are set to Slide/None

The user expects my app to switch off the screen after being used. At the moment, I achieve this with Device Administrator rights and DevicePolicyManager.lockNow(), which works fine if the security settings are set to PIN/Pattern/FaceUnlock, etc.…
Nick
  • 3,504
  • 2
  • 39
  • 78
11
votes
2 answers

Android: Programmatically remove my app from Device Administrator?

I'm trying to add a button to my app to remove it from Device Administrator and am using the code below but my app just crashes. Code:- On Button Click:- { ComponentName devAdminReceiver = new ComponentName(this, DemoDeviceAdminReceiver.class); …
10
votes
5 answers

Android - Activation of the system key lock (aka lock screen)

I have to activate android's system key lock (the one you get when you press the power off/hang up button). See here: I already browsed the docs but everything I found was PowerManager and KeyguardManager. Both seem not to be the solution :-(. So,…
Johannes Weiss
  • 52,533
  • 16
  • 102
  • 136
10
votes
4 answers

Lock screen without disabling fingerprint

I have the following problem. I'm trying to make an app that locks the screen. The method via DevicePolicyManager works very well. So far so good. But when I lock my phone with DPM the fingerprint unlocking method is disabling and I have to enter…
ChesterKing
  • 103
  • 1
  • 1
  • 5
10
votes
1 answer

Android 4.3 DeviceAdmin error for non owner profile

I am using a Nexus 7 which is updated to Android 4.3. I have an application which requires Device Admin rights to Lock/ Wipe device. I have given Device Admin right to my application on Owner Profile. So when i switch to another user profile, i can…
Alok Kulkarni
  • 2,153
  • 19
  • 31
8
votes
2 answers

Make my Android app to fully kiosk mode when enabled

I am trying to make my feedback app to support fully kiosk, I have tried a lot of solutions but Nothing is completely satisfying my need. Here are the things that I found yet. 1. Make my app as Device Admin/Owner App(Lock Task) - If we follow this…
B.shruti
  • 1,589
  • 1
  • 21
  • 41
8
votes
4 answers

How to prevent users from turning off GPS, Wifi and Bluetooth?

I'm developing a tracking application and I need to prevent users from turning off the basic sensors used to determine the location. I can not modify the devices ROM or have root access (or at least it would be very desirable to had not), but I…
8
votes
3 answers

device policy administration errors with Android

I recently started exploring the android device policy administration APIs and have run into a bit of a wall. i'm having problems simply enabling the device administration. I'm fairly certain it is a problem with the manifest entry, however I can't…
Jainathan Leung
  • 1,147
  • 2
  • 15
  • 27
8
votes
2 answers

How to retain fingerprint unlock after using lockNow in Android 6.0?

How do we retain the seamless fingerprint unlocking effect after using DevicePolicyManager to perform lockNow() in Android 6.0? Assuming on devices with fingerprint scanner and the app calling lockNow() has "USES_POLICY_FORCE_LOCK" and had been…
Duy Nguyen
  • 2,869
  • 1
  • 12
  • 6
1
2 3
15 16