android - Tell if device is running a MIUI software -


i need know if app running on miui device xiaomi @ runtime due issues pre android 6.0 permissions etc.

is there way to it?

i've found gist on github aims that, trying fetch "ro.miui.ui.version.name" system property.

public static boolean ismiui() {     return !textutils.isempty(getsystemproperty("ro.miui.ui.version.name")); }  public static string getsystemproperty(string propname) {     string line;     bufferedreader input = null;     try {         java.lang.process p = runtime.getruntime().exec("getprop " + propname);         input = new bufferedreader(new inputstreamreader(p.getinputstream()), 1024);         line = input.readline();         input.close();     } catch (ioexception ex) {         return null;     } {         if (input != null) {             try {                 input.close();             } catch (ioexception e) {                 e.printstacktrace();             }         }     }     return line; } 

origin on github


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -