简体   繁体   中英

Extracting IMEI on LG G2 Handset

I need to pull the IMEI in my app, so I use getDeviceId(). On most handsets, that works fine, but the LG G2 only returns 14 digits instead of the expected 15.

Does anyone have any idea why?

Does anyone know of a different way to get IMEI?

I've read that it's possible to read it from /data/data/com.android.providers/settings.db (or similar), but that appears to be locked, and I'd prefer to avoid cracking any of Android's locked APIs.

Thanks.

On some phones, you can get a 14 digit IMEI. That is ok.

The last digit is a checksum calculated using the previous 14. If you want to, you can calculate it here: http://www.imei.info/calc

Or you can use the Luhn algorithm to calculate it yourself (it is also used qith credit cards, so I'm sure you won't have much difficulties finding an example).

Anyway, 14 digits is perfectly ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM