I setup a device owner application provisioning app as shown in google sample NFC Provisioning , with additional features to setup EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION
and EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM
. I would like as shown in the video of Google I/O 2016, to provide both device owner app and cosu app.
How can I achieve this goal?
I should setup a single app which is both cosu and device owner or I have to provide download location automatically via nfc through provisioning app and instruct my device owner to download and install the specific app?
You can do both, it depends on your requirements. Google is using option 2.
option 1: Your device owner app can set itself as approved for lock task mode. Then, on provisioning complete or boot complete, start your activity and call startLockTask().
option 2: After provisioning the device with you device owner app (device policy controller), you can download, silently install, whitelist for lock task mode, and then start the activity. I recommend passing cosu app download information to your DPC via NFC/QR code during provisioning using EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE.
Additionally, I would check out this link for more information: https://developer.android.com/work/cosu.html
You also have the option to use a third-party EMM or Google's relatively new Android Management API.