Android examples for android.os:Build
is Running On Emulator
//package com.java2s; import android.os.Build; public class Main { public static boolean isRunningOnEmulator() { boolean result = // Build.FINGERPRINT.startsWith("generic")// || Build.FINGERPRINT.startsWith("unknown")// || Build.MODEL.contains("google_sdk")// || Build.MODEL.contains("Emulator")// || Build.MODEL.contains("Android SDK built for x86") || Build.MANUFACTURER.contains("Genymotion"); if (result) return true; result |= Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"); if (result) return true; result |= "google_sdk".equals(Build.PRODUCT); return result; }//from w ww .jav a 2 s . c o m }