I want to get the Vendor ID
of my Android Device through my code.
I have read this: http://developer.android.com/tools/device.html, but it does not tell you how to retrieve it through code.
I have even searched in android.os.Build.<attributes>
but none of them gives the VendorID
.
Can any one tell me?
Locate the unknown device, right-click on it, and select Properties. Navigate to the Details tab. Click on the Property dropdown menu, and select Hardware Ids from the list of options. Now, the number next to VID or VEN is the Vendor ID.
Fortunately, there's an easy way to find the Vendor ID (and Product ID) of any device connected to a Windows PC. The device doesn't even need drivers for this approach to work: Start Device Manager. In the Hardware tree, right-click the hardware entry for the device for which the Vendor ID is to be determined.
As the requirement for most of applications is to identify a particular installation and not a physical device, a good solution to get unique id for an user if to use UUID class. String uniqueID = UUID. randomUUID(). toString();
Settings. Secure#ANDROID_ID returns the Android ID as an unique for each user 64-bit hex string. It's known to be null sometimes, it's documented as "can change upon factory reset". Use at your own risk, and it can be easily changed on a rooted phone.
If you are running Ubuntu/Linux just type in terminal lsusb -v
and press enter.
It will bring out details of all USB devices.
Check for a field called idVendor
in the results and find your device.
E.g. my Motorola Defy (vendor id = 22b8) gives:
idVendor 0x22b8 Motorola PCS
may be android.os.Build.MANUFACTURER is what you are looking for..
There is also one more field called brand android.os.Build.BRAND which specify The brand (e.g., carrier) the software is customized for, if any.
You can also try our Phone Info app from app store to check these value on your device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With