Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Created November 26, 2021 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/a9e99c17e84f4f87cfd7e4c219b4de23 to your computer and use it in GitHub Desktop.
Save victorbrndls/a9e99c17e84f4f87cfd7e4c219b4de23 to your computer and use it in GitHub Desktop.
public static boolean isEmulator(Context context) {
String androidId = Secure.getString(context.getContentResolver(), "android_id");
return Build.PRODUCT.contains("sdk") || Build.HARDWARE.contains("goldfish") || Build.HARDWARE.contains("ranchu") || androidId == null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment