I have read this stackoverflow thread already and I tried using the code given in that answer to find out if I run my code on the emulator or on a real device:
import android.content.ContentResolver;
import android.provider.Settings.Secure;
...
mTextView.setText(Secure.getString(getContentResolver(), Secure.ANDROID_ID));
On my real device it returns "2bccce3...", however on the emulator it does not return null, but also a string "bd9f8..."
Ideas how to find out if emulator or real device from code would be highly appreciated
How about this solution: