Android Emulator Check isEmulator()

Here you can find the source of isEmulator()

Description

is Emulator

Return

true if the device is the emulator, false if actual device.

Declaration

public static boolean isEmulator() 

Method Source Code

//package com.java2s;

import android.os.Build;

public class Main {
    /** @return true if the device is the emulator, false if actual device. 
     *//* w w  w . ja  v a2s.c  o m*/
    public static boolean isEmulator() {
        //return Build.MANUFACTURER.equals("unknown");
        return ("google_sdk".equals(Build.PRODUCT) || "sdk"
                .equals(Build.PRODUCT));
    }
}

Related

  1. setIsEmulator()
  2. isEmulator()