1. 程式人生 > >如何獲取華為手機上EMUI版本號?

如何獲取華為手機上EMUI版本號?

Class<?> classType = Class.forName("android.os.SystemProperties");
Method getMethod = classType.getDeclaredMethod("get", new Class<?>[] {String.class});
String buildVersion = (String)getMethod.invoke(classType, new Object[] {"ro.build.version.emui"});
注意:需要最低SDK版本19