How to Retrieve the Firmware (OS) Version

From wizarPOS
Revision as of 09:38, 26 February 2020 by Mahong (talk | contribs) (Created page with "== By system property == property name: ro.wp.system.ver // returned version such as 1.0.0-3928 String prop = getProperty("ro.wp.system.ver",""); publ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

By system property

   property name: ro.wp.system.ver
   // returned version such as 1.0.0-3928
   String prop = getProperty("ro.wp.system.ver",""); 
      
   public static String getProperty(String key, String defaultValue) {
       String value = defaultValue;
       try {
           Class<?> c = Class.forName("android.os.SystemProperties");
           Method get = c.getMethod("get", String.class, String.class);
           value = (String)(get.invoke(c, key, defaultValue ));
       } catch (Exception e) {
           e.printStackTrace();
       }finally {
           return value;
       }
   }

By android Build Class

   android.os.Build.DISPLAY