2

I want to make my app as Device Owner without using NFC. On developer blog it's mentioned that to make device owner you must use NFC but I found it is also possible without NFC as mentioned by alex_au in this comment.

I have tried this but haven't been successful. Has anybody been able to accomplish this?

tambre
  • 4,625
  • 4
  • 42
  • 55
sunil jain
  • 130
  • 2
  • 11

1 Answers1

5

You can use command line tool dpm from adb shell.

Usage:

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.

For more information check: dpm shell command

Note: Before using this command make sure that device is not provisioned. If device is provisioned and you get message like "Device is already provisioned" try the command after removing all the accounts from device or try after factory resetting the device.

Akhil
  • 829
  • 1
  • 11
  • 26
  • 1
    it's good for development but we can not use it for production use. – sunil jain Jan 27 '15 at 09:30
  • Yes @Spynet but how end user use it if they want to make my app as device owner – sunil jain Jan 27 '15 at 09:41
  • 3
    Hi @Sunil Jain currently there is no such way to make your application as device owner in production. It is only for company-owned devices where IT administrators can start with a new device and configure it with a device owner. Employers can issue these devices with a device owner app already installed that can configure global device settings. Google might provides the Non NFC provisioning mechanism in future release :) – Akhil Jan 29 '15 at 05:07