Identifying an Emulator in Android 2.2
Previously, I had advised people to check to see if
null if they wanted to determine if their device was
an emulator. That had two flaws:
ANDROID_IDis stored in a system SQLite database, so a rooted device might somehow hack in a null value.
ANDROID_IDis actually tied into Google accounts and such, and now you can actually set up a Google account on your Android 2.2 device.
ANDROID_ID is no longer
null in the emulator.
Another suggestion from StackOverflow that seems to work is:
This seems to hold true for the 1.5, 1.6, 2.1, and 2.2 emulators, which means it is a promising technique.
The AndroidX Tech site contains source code, transitive dependency details, and much more for Google’s