I would like to have my code run slightly differently when running on the emulator than when running on a device. (For example, using 10.0.2.2 instead of a
Actually, ANDROID_ID on 2.2 always equals 9774D56D682E549C (according to this thread + my own experiments).
So, you could check something like this:
String androidID = ...; if(androidID == null || androidID.equals("9774D56D682E549C")) do stuff;
Not the prettiest, but it does the job.