is Running On Emulator - Android Android OS

Android examples for Android OS:Emulator

Description

is Running On Emulator

Demo Code

import android.os.Build;

public class Main {


  public static boolean isRunningOnEmulator() {
    return Build.BRAND.contains("generic") || Build.DEVICE.contains("generic") || Build.PRODUCT.contains("sdk")
        || Build.HARDWARE.contains("goldfish") || Build.MANUFACTURER.contains("Genymotion")
        || Build.PRODUCT.contains("vbox86p") || Build.DEVICE.contains("vbox86p") || Build.HARDWARE.contains("vbox86");
  }//  w w w .  j  av a2s .c o  m

}

Related Tutorials