Is There Any Way To Get Android Management Api Device Id From App
Solution 1:
It is not possible for your app to directly access the device ID.
However you can achieve a similar result by exposing a managed configuration in your app with one string and configuring it in the ApplicationPolicy
with a different policy for each device. The managed configuration can contain a string property that you set to the device ID for each device.
The managed configuration file in your app would look like:
<restrictionsxmlns:android="http://schemas.android.com/apk/res/android"><restrictionandroid:key="deviceId"android:title="ID of the device"android:restrictionType="string" /></restrictions>
And the policy would look like:
{"applications":[{"packageName":"com.example","installType":"FORCE_INSTALLED","managedConfiguration":{"deviceId":"1a2b3c4d5e6f"}}]}
In addition, to set the policy as soon as a new device is enrolled you can set up Pub/Sub notifications and listen for ENROLLMENT
events, the data
field of the notification contains a Device
resource with the device ID, therefore allowing you to create a new policy and assign it to the device.
Solution 2:
I don't agree with this solution, as far i know people are reading policy information from device and map it with Kiosk Application.
Post a Comment for "Is There Any Way To Get Android Management Api Device Id From App"