Return true if device has the Dalvik runtime, otherwise false. - Android Android OS

Android examples for Android OS:System Model

Description

Return true if device has the Dalvik runtime, otherwise false.

Demo Code


import android.os.SystemPropertiesReflect;

public class Main{
    private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib";
    private static final String LIB_DALVIK = "libdvm.so";
    /** Return true if device has the Dalvik runtime, otherwise false. */
    public static boolean isRuntimeDalvik() {
        return getCurrentRuntime().equalsIgnoreCase(LIB_DALVIK);
    }//from w  w  w .  java2  s .com
    /** Return the current runtime, otherwise null.
     * @return current runtime
     */
    public static String getCurrentRuntime() {
        return SystemPropertiesReflect.get(SELECT_RUNTIME_PROPERTY);
    }
}

Related Tutorials