Monday, 26 June 2017

How to identify an Android device programmatically?




Currently, I am using MAC address as the identifier for an Android device.



WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo wInfo = wifiManager.getConnectionInfo();
String mac = wInfo.getMacAddress();


However, I found the mac is empty for some users' devices. I am a little confused why it could be empty.




If you could figure out the reason, that's the best!



Otherwise, could you provide an alternative for identifying an Android device?


Answer



Your best bet with finding something unique about the Android device would be to access its serial number. There are several other posts on how to do this, but the most-viewed one is here:



How to find serial number of Android device?


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...