Possible Duplicate:
How to find serial number of Android device?
how can i get device serial number
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.
from Telephony reading Settings.Secure.ANDROID_ID. "This is a 64-bit quantity that is generated and stored when the device first boots"
精彩评论