Android examples for Android OS:System Model
Return true if device has the ART or ART debug build runtime, otherwise false.
import android.os.SystemPropertiesReflect; public class Main{ private static final String SELECT_RUNTIME_PROPERTY = "persist.sys.dalvik.vm.lib"; private static final String LIB_ART = "libart.so"; private static final String LIB_ART_D = "libartd.so"; /** Return true if device has the ART or ART debug build runtime, otherwise false. */ public static boolean isRuntimeArt() { String runtime = getCurrentRuntime(); return runtime.equalsIgnoreCase(LIB_ART) || runtime.equalsIgnoreCase(LIB_ART_D); }/* w w w . j av a 2s . c o m*/ /** Return the current runtime, otherwise null. * @return current runtime */ public static String getCurrentRuntime() { return SystemPropertiesReflect.get(SELECT_RUNTIME_PROPERTY); } }