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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top