From the method description, the method returns null if device ID is not available. It seems like during boot time, for some reason, the device ID is indeed not available. I think you can possibly use this blog post to meet your needs.
TelephonyMagager.getDeviceId fails during BootTime on Galaxy S3
Question
My app uses TelephonyMagager.getDeviceId()
to get the device's IMEI. I have implemented a service which starts during boot time. This works on Xperia (4.0.4) and Nexus (4.1.1) without problems.
On Galaxy S3 (running 4.1.1), getDeviceId()
works fine if I start the service after boot time, but it returns NULL
if I let the service start during boot time.
Any ideas?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow