The code on my blog at http://mysticlakesoftware.blogspot.com/2009/07/differentiate-emulator-from-device.html might give you some ideas.
>From my limited testing with the emulator and a G1 the call to Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID); always returns null on the emulator and a value on the device. Rud http://mysticlakesoftware.blogspot.com/ On Jul 22, 3:05 pm, Mathieu Plourde <[email protected]> wrote: > Hello devs, > > I need to correctly be able to differentiate between emulator > instances. I know it's easily done with real devices. With real > devices, you can use getDeviceId or getLine1Number from > TelephonyManager. With emulators, all the instances have the same > device id, same subscriber id, and same line1 number. Is there a way > to differentiate them? Using NetworkInfo, I can call the toString > method and I get my ip and the port on the computer. The problem with > that is that the port is always different. I would like something more > stable. Like when you use "adb devices" in command line. Emulator #1 > is almost always "emulator-5556" and emulator#2 is almost always > "emulator-5554". Is there a way to get the same info I get from "adb > devices" in my code? If not, is it possible to use a command line > parameter to force the emulator to use a certain phone number? > > Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

