Thanks Mark, I set this once in a global Config class: public static final boolean IS_EMULATOR = android.provider.Settings.Secure.ANDROID_ID == null;
For the maps, yeah I'll have to just create the MapView instance through code, you can pass the key in through the constructor, I guess that should work, Thanks On Oct 26, 2:33 pm, "Mark Murphy" <[email protected]> wrote: > > Is there a way to check if our code is running in the emulator vs a > > real device? > > ANDROID_ID should be null on the emulator and non-null on a device: > > http://developer.android.com/reference/android/provider/Settings.Secu... > > > I'm using a MapView which requires a signing key. I'm using the > > signature of the eclipse debug key when running on the emulator, but > > this won't work when I build a release version. I think I need to have > > a check to see if I'm running on a real device, and set it to the real > > release key at that time. > > I don't see a setter for the API key in the MapView docs. You could, > though, have two different editions of the layout, one with each key, and > load in the right copy of the layout based on emulator vs. device. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android App Developer Books:http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

