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; }
Comments
Post a Comment