Android Device Id Guide

VH
Last updated 3 months ago

Learn how to create a good device identifier

Pushlink Start

As you may have noticed, the last Pushlink.start parameter is "yourDeviceId".

PushLink.start(this, R.mipmap.ic_launcher, "yourApiKey", "yourDeviceID");

It's up to you to identify the device. See below all you need to know to retrieve a good identifier.

Disclaimer

There is not a default and 100% guarantee way to retrieve the Device ID on Android. It depends on OS version, device brand, etc.

However, PushLink is designed for enterprise apps, and the developer has a certain control over which types of Devices and OS the application is going to run. Don't use an ID which is changed after every uninstall/install. Try to use a long live ID. Think and create your own strategy.

Suggestions

Are you sure that factory resets won't happen?

Maybe use the Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID), if devices are over android version 2.2.

Are you sure your devices are phone devices with good ROM's?

Maybe use the IMEI number.

Are you sure that all devices aren't phone devices?

Maybe use the android.os.Build.SERIAL, if devices are over android version 2.3.

Do you have control over detachable media?

Maybe use the SIM serial number or SDCARD number.

Are you sure that it runs in a LAN environment?

Maybe use the MAC address.

Must read

What happens if I set the same ID in different devices?

Don't do that. You will not be able to manage your installations properly. This will create all sort of problems.

What happens if my device ID changes frequently?

First, your information will be a mess. You will see a lot of installations on the web administration, and you won't be able manage them. Second, we charge based on installations, so you can be charge twice or more for one device running one application.

What more should I be alert?

Be careful with not certified roms.

  • Fake IMEI like '004999010640000'.

  • Fake Settings.Secure.ANDROID_ID like '9774d56d682e549c'.