Monday, June 11, 2012

Check Run apk in Emulator or real Device

public boolean isAndroidEmulator() {
        String model = Build.MODEL;
        Log.d("IS Model", "model=" + model);
        String product = Build.PRODUCT;
        Log.d("IS Product", "product=" + product);
        boolean isEmulator = false;
        if (product != null) {
            isEmulator = product.equals("sdk") || product.contains("_sdk")
                    || product.contains("sdk_");
        }
        Log.d("imulator", "isEmulator=" + isEmulator);
        return isEmulator;
    }

No comments:

Post a Comment