1

In Android devices how is the unique Serial number is assigned to each device? Most of the Samsung devices have a unique serial number on each device. When is this serial number is inserted? Is this serial number assigned before firmware installation or after installing the firmware? Or it has some mechanisim/ algorithm to assign the serial number during firmware is installed.

I want to burn firmware to devices but need some algorithm which helps me to assign the unique serial number to each device and it will remain same even if the firmware is burned multiple times.

user207421
  • 305,947
  • 44
  • 307
  • 483
dwtester
  • 35
  • 2
  • 4

2 Answers2

2

There are several options to identify a unique serial number in a android device. One of them being IMEI and another most commonly used is MAC. But from Android M version google has restrictions on people using MAC for unique identity and moreover you will need to have WIFI to be ON to read the MAC. And also it is not advisable to use MAC/IMEI for secure reasons.

One other possible solution is to generate a unique global identifier in your code.

String uniqueID = UUID.randomUUID().toString.

At the highest level, a globally unique identifier will never have a collision - even on other devices/apps.

Source : https://developer.android.com/training/articles/user-data-ids.html#working_with_instance_ids_&_guids.

You can also try using android serial number which is unique number generated on first ever boot. But, please note that the serial number changes on Factory data reset.

For detailed insight into unique identifier please also look into android device id confusion

Hope I have answered your query.

Nara
  • 53
  • 1
  • 9
1

The unique number is called IMEI. It is a unique number inserted in phone by the manufacturers. Every phone on earth has a different IMEI. Though with rooting your phone you can spoof it.

Hope this helps.

Sarthak Gandhi
  • 2,130
  • 1
  • 16
  • 23
  • 1
    Thanks, Sarthak for the suggestion about IMEI, I am looking for Serial number option in Android devices. My goal is to assign the unique Serial number to the number of devices but for this what kind of changes do I need to make in an Android Source code. Which will assign the unique Serial number to all the devices when the firmware is burnt. – dwtester May 30 '17 at 13:27