Gota Yashiki (born 1962), both an independent acid jazz artist and drum/bass player, as a member of the band Simply Red Gota Yamashita (born 1989), Japanese mixed martial artist Places [ edit ]. How to get BIOS serialnumber with WMIC command. Ask Question 4. Whenever I use the command line below. Wmic bios get serialnumber. There is a field for the serial number (and other fields for much more information) in many generic BIOSes and methods to read these fields.
Posted by2 years ago
Archived
What's your G5 serial number S/N ?
Hi, just got a new G5 H850 European version, and saw it has a 604K.. serial number (on the side of the white box). After seeing this 'https://youtu.be/vvFe8RKjxas?t=768' I am curious about the differences between the new and old serial number G5's, wondering if I should return it. Mine was bought 9 November 2016 (officially imported by LG in Romania) and it came with a 604K serial, meaning April 2016, why could it be so old, didn't they renew the stock for 7 months ? Also, the HW revision from Settings->About Hardware is Rev 1.0, and on the green box it says 'MAY66193505(1.0)WR'.
What are your serial numbers and purchase dates ? Does anyone have a HW revision bigger that 1.0 ? Thanks.
47% Upvoted
I need to use a unique ID for an Android app and I thought the serial number for the device would be a good candidate. How do I retrieve the serial number of an Android device in my app ?
EnoEno
16 Answers
getSystemService is a method from the Activity class. getDeviceID() will return the MDN or MEID of the device depending on which radio the phone uses (GSM or CDMA).
Each device MUST return a unique value here (assuming it's a phone). This should work for any Android device with a sim slot or CDMA radio. You're on your own with that Android powered microwave ;-)
hasemanhaseman
As Dave Webb mentions, the Android Developer Blog has an article that covers this.
I spoke with someone at Google to get some additional clarification on a few items. Here's what I discovered that's NOT mentioned in the aforementioned blog post:
- ANDROID_ID is the preferred solution. ANDROID_ID is perfectly reliable on versions of Android <=2.1 or >=2.3. Only 2.2 has the problems mentioned in the post.
- Several devices by several manufacturers are affected by the ANDROID_ID bug in 2.2.
- As far as I've been able to determine, all affected devices have the same ANDROID_ID, which is 9774d56d682e549c. Which is also the same device id reported by the emulator, btw.
- Google believes that OEMs have patched the issue for many or most of their devices, but I was able to verify that as of the beginning of April 2011, at least, it's still quite easy to find devices that have the broken ANDROID_ID.
Based on Google's recommendations, I implemented a class that will generate a unique UUID for each device, using ANDROID_ID as the seed where appropriate, falling back on TelephonyManager.getDeviceId() as necessary, and if that fails, resorting to a randomly generated unique UUID that is persisted across app restarts (but not app re-installations).
emmbyemmby
This code returns device serial number using a hidden Android API.
Roman SLRoman SL
Although, it is not guaranteed that the Android ID will be an unique identifier.
Anthony ForloneyAnthony Forloney
There is an excellent post on the Android Developer's Blog discussing this.
It recommends against using
TelephonyManager.getDeviceId()
as it doesn't work on Android devices which aren't phones such as tablets, it requires the READ_PHONE_STATE
permission and it doesn't work reliably on all phones.Instead you could use one of the following:
- Mac Address
- Serial Number
- ANDROID_ID
The post discusses the pros and cons of each and it's worth reading so you can work out which would be the best for your use.
Dave WebbDave Webb
For a simple number that is unique to the device and constant for its lifetime (barring a factory reset or hacking), use Settings.Secure.ANDROID_ID.
To use the device serial number (the one shown in 'System Settings / About / Status') if available and fall back to Android ID:
Edward BreyEdward Brey
The IMEI is good but only works on Android devices with phone. You should consider support for Tablets or other Android devices as well, that do not have a phone.
You have some alternatives like: Build class members, BT MAC, WLAN MAC, or even better - a combination of all these.
I have explained these details in an article on my blog, see: http://www.pocketmagic.net/?p=1662
radhooradhoo
Since no answer here mentions a perfect, fail-proof ID that is both PERSISTENT through system updates and exists in ALL devices (mainly due to the fact that there isn't an individual solution from Google), I decided to post a method that is the next best thing by combining two of the available identifiers, and a check to chose between them at run-time.
Before code, 3 facts:
TelephonyManager.getDeviceId()
(a.k.a.IMEI) will not work well or at all for non-GSM, 3G, LTE, etc. devices, but will always return a unique ID when related hardware is present, even when no SIM is inserted or even when no SIM slot exists (some OEM's have done this).- Since Gingerbread (Android 2.3)
android.os.Build.SERIAL
must exist on any device that doesn't provide IMEI, i.e., doesn't have the aforementioned hardware present, as per Android policy. - Due to fact (2.), at least one of these two unique identifiers will ALWAYS be present, and SERIAL can be present at the same time that IMEI is.
Note: Fact (1.) and (2.) are based on Google statements
SOLUTION
With the facts above, one can always have a unique identifier by checking if there is IMEI-bound hardware, and fall back to SERIAL when it isn't, as one cannot check if the existing SERIAL is valid. The following static class presents 2 methods for checking such presence and using either IMEI or SERIAL:
I would advice on using
getCleartextID_HARDCHECK
. If the reflection doesn't stick in your environment, use the getCleartextID_SIMCHECK
method instead, but take in consideration it should be adapted to your specific SIM-presence needs.P.S.: Do please note that OEM's have managed to bug out SERIAL against Google policy (multiple devices with same SERIAL), and Google as stated there is at least one known case in a big OEM (not disclosed and I don't know which brand it is either, I'm guessing Samsung).
Disclaimer: This answers the original question of getting a unique device ID, but the OP introduced ambiguity by stating he needs a unique ID for an APP. Even if for such scenarios Android_ID would be better, it WILL NOT WORK after, say, a Titanium Backup of an app through 2 different ROM installs (can even be the same ROM). My solution maintains persistence that is independent of a flash or factory reset, and will only fail when IMEI or SERIAL tampering occurs through hacks/hardware mods.
leRobotleRobot
There are problems with all the above approaches. At Google i/o Reto Meier released a robust answer to how to approach this which should meet most developers needs to track users across installations.
This approach will give you an anonymous, secure user ID which will be persistent for the user across different devices (including tablets, based on primary Google account) and across installs on the same device. The basic approach is to generate a random user ID and to store this in the apps shared preferences. You then use Google's backup agent to store the shared preferences linked to the Google account in the cloud.
Lets go through the full approach. First we need to create a backup for our SharedPreferences using the Android Backup Service. Start by registering your app via this link: http://developer.android.com/google/backup/signup.html
Google will give you a backup service key which you need to add to the manifest. You also need to tell the application to use the BackupAgent as follows:
Then you need to create the backup agent and tell it to use the helper agent for sharedpreferences:
Gota Serial Number
To complete the backup you need to create an instance of BackupManager in your main Activity:
Finally create a user ID, if it doesn't already exist, and store it in the SharedPreferences:
This User_ID will now be persistent across installations, even if the user switches devices.
For more information on this approach see Reto's talk here http://www.google.com/events/io/2011/sessions/android-protips-advanced-topics-for-expert-android-app-developers.html
And for full details of how to implement the backup agent see the developer site here: http://developer.android.com/guide/topics/data/backup.html I particularly recommend the section at the bottom on testing as the backup does not happen instantaneously and so to test you have to force the backup.
TechnoTonyTechnoTony
Another way is to use /sys/class/android_usb/android0/iSerial in an App with no permissions whatsoever.
To do this in java one would just use a FileInputStream to open the iSerial file and read out the characters. Just be sure you wrap it in an exception handler because not all devices have this file.
At least the following devices are known to have this file world-readable:
- Galaxy Nexus
- Nexus S
- Motorola Xoom 3g
- Toshiba AT300
- HTC One V
- Mini MK802
- Samsung Galaxy S II
You can also see my blog post here: http://insitusec.blogspot.com/2013/01/leaking-android-hardware-serial-number.html where I discuss what other files are available for info.
insitusecinsitusec
As @haserman says:
But it's necessary including the permission in the manifest file:
cesardscesards
Unique device ID of Android OS Device as String.
Android Serial Number In Settings
but I strngly recommend this method suggested by Google::
ElenasysElenasys
Build.SERIAL
is the simplest way to go, although not entirely reliable as it can be empty or sometimes return a different value (proof 1, proof 2) than what you can see in your device's settings.There are several ways to get that number depending on the device's manufacturer and Android version, so I decided to compile every possible solution I could found in a single gist. Here's a simplified version of it :
flawyteflawyte
I know this question is old but it can be done in one line of code
Computer Serial Number Lookup
String deviceID = Build.SERIAL;
MichaelStoddartMichaelStoddart
I found the example class posted by @emmby above to be a great starting point. But it has a couple of flaws, as mentioned by other posters. The major one is that it persists the UUID to an XML file unnecessarily and thereafter always retrieves it from this file. This lays the class open to an easy hack: anyone with a rooted phone can edit the XML file to give themselves a new UUID.
I've updated the code so that it only persists to XML if absolutely necessary (i.e. when using a randomly generated UUID) and re-factored the logic as per @Brill Pappin's answer:
Carlos PCarlos P
Yes. It is a device hardware serial number and it is unique. So on api level 2.3 and above you can use android.os.Build.ANDROID_ID to get it. For below 2.3 API level use TelephonyManager.getDeviceID().
you can read this http://android-developers.blogspot.in/2011/03/identifying-app-installations.html
Mahesh Ramchandra BhatkandeMahesh Ramchandra Bhatkande