Android is the way to judge whether a cell phone is a millet MIUI system _android

Source: Internet
Author: User

No more nonsense to say, directly to everyone to paste the code:

The specific code looks like this:

public class Miuiutils {//Detect MIUI private static final String Key_miui_version_code = "Ro.miui.ui.version.code"; 
private static final String Key_miui_version_name = "Ro.miui.ui.version.name"; 
private static final String key_miui_internal_storage = "Ro.miui.internal.storage"; The public static Boolean Ismiui () {<span style= "white-space:pre" > </span>//gets the cached state if (sputils.getinstance). 
Getcachedatasp (). Contains ("ISMIUI")) {return sputils.getinstance (). getcachedatasp (). Getboolean ("Ismiui", false); 
Properties prop= new Properties (); 
Boolean ismiui; 
try {prop.load (New FileInputStream (Environment.getrootdirectory (), "Build.prop")); 
catch (IOException e) {e.printstacktrace (); 
return false; } ismiui= prop.getproperty (Key_miui_version_code, NULL)!= null | | Prop.getproperty (key_miui_version_name, NULL)!= null | | 
Prop.getproperty (key_miui_internal_storage, NULL)!= null; 
Sputils.getinstance (). Putcachedata ("Ismiui", ISMIUI);//save MIUI return ISMIUI;}} 

The above code is based on Android to determine whether the phone is a millet minu system method, I hope to help!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.