Starting with Android 10 (API level 29), programmatic access to device identifiers like IMEI, MEID, and Serial Number has been heavily restricted. As a result, many applications that rely on this information can no longer retrieve it directly.
To address this, Urmobo MDM provides a secure way for clients to continue accessing these identifiers through our app, fully aligned with Android's updated privacy policies.
📲 Requesting Device Information from Urmobo MDM
Begin by sending an Intent to Urmobo requesting the device data, as shown below:
Intent request = new Intent("com.urmobo.mdm.GET_DEVICE_DATA");
request.setPackage("com.urmobo.mdm");
// Create a PendingIntent to receive the response
Intent replyIntent = new Intent("com.client.RESPONSE_INFO");
PendingIntent replyPending = PendingIntent.getBroadcast(
context, 0, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE
);
// Attach the PendingIntent to the original Intent
request.putExtra("UrmoboReply", replyPending);
// Send the broadcast
context.sendBroadcast(request);
📥 Receiving the Response
Once Urmobo MDM processes the request, it sends the data back to your app. To receive the information, register a BroadcastReceiver as shown below:
BroadcastReceiver responseReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String id = intent.getStringExtra("UrmoboID");
String imei = intent.getStringExtra("IMEI");
String serial = intent.getStringExtra("SerialNumber");
}
};
IntentFilter filter = new IntentFilter("com.client.RESPONSE_INFO");
context.registerReceiver(responseReceiver, filter);
🔁 Customizing the Action
The action "com.client.RESPONSE_INFO" can (and should) be adjusted to match your app’s package name or preferred action string. This ensures the receiver only listens to the expected broadcasts.
With this approach, you can securely retrieve:
- UrmoboID (a unique identifier generated by Urmobo)
- IMEI(s) (multiple values are separated by
;) - Serial Number of the device
This ensures compliance with Android's restrictions while maintaining access to critical device identifiers. ✅