Actually there is a method other than NFC, and rooting to install the application as the device owner’s application. You can use the dpm command line tool from adb shell .
Using:
usage: dpm [subcommand] [options] usage: dpm set-device-owner <COMPONENT> usage: dpm set-profile-owner <COMPONENT> <USER_ID> dpm set-device-owner: Sets the given component as active admin, and its package as device owner. dpm set-profile-owner: Sets the given component as active admin and profile owner for an existing user.
UPDATE: The dpm utility dpm really simple. Its purpose is to create a new file called device_owner.xml under /data/system/device_owner.xml , which refers to Device / Profile owner applications.
The Android platform then reads this file to check which application is considered as the device owner or the application for the profile owner.
On the root device , you can actually create this file yourself , but since the dpm tool does this, you better use it (DRY principle):
For example , using the Runtime.exec() command:
Runtime.getRuntime().exec("dpm set-device-owner com.foo.deviceowner/.DeviceAdminRcvr");
Also note that this tool only works if the user does not have an account (make sure that the account is not set in Settings> Accounts) before using it.
Source and additional information in the Android Shell Command Shell Tool: Device Policy Manager
Florent Dupont Jan 12 '15 at 19:28 2015-01-12 19:28
source share