当前位置:   article > 正文

android获取ro._android 获取设备 厂商,型号, 等信息的 类

ro.product.name取值

packageandroid.os;importcom.android.internal.telephony.TelephonyProperties;public classBuild {

public static finalString UNKNOWN= "unknown";public static finalString ID= getString("ro.build.id");public static finalString DISPLAY= getString("ro.build.display.id");public static finalString PRODUCT= getString("ro.product.name");public static finalString DEVICE= getString("ro.product.device");public static finalString BOARD= getString("ro.product.board");public static finalString CPU_ABI= getString("ro.product.cpu.abi");public static finalString CPU_ABI2= getString("ro.product.cpu.abi2");public static finalString MANUFACTURER= getString("ro.product.manufacturer");public static finalString BRAND= getString("ro.product.brand");public static finalString MODEL= getString("ro.product.model");public static finalString BOOTLOADER= getString("ro.bootloader");@Deprecatedpublic static finalString RADIO= getString(TelephonyProperties.PROPERTY_BASEBAND_VERSION);public static finalString HARDWARE= getString("ro.hardware");public static finalString SERIAL= getString("ro.serialno");public static classVERSION {

public static finalString INCREMENTAL= getString("ro.build.version.incremental");public static finalString RELEASE= getString("ro.build.version.release");@Deprecatedpublic static finalString SDK= getString("ro.build.version.sdk");public static final intSDK_INT= SystemProperties.getInt(

"ro.build.version.sdk",0);public static finalString CODENAME= getString("ro.build.version.codename");public static final intRESOURCES_SDK_INT= SDK_INT+ ("REL".equals(CODENAME) ? 0: 1);}

public static classVERSION_CODES {

public static final intCUR_DEVELOPMENT= 10000;public static final intBASE= 1;public static final intBASE_1_1= 2;public static final intCUPCAKE= 3;public static final intDONUT= 4;public static final intECLAIR= 5;public static final intECLAIR_0_1= 6;public static final intECLAIR_MR1= 7;public static final intFROYO= 8;public static final intGINGERBREAD= 9;public static final intGINGERBREAD_MR1= 10;public static final intHONEYCOMB= 11;public static final intHONEYCOMB_MR1= 12;public static final intHONEYCOMB_MR2= 13;public static final intICE_CREAM_SANDWICH= 14;public static final intICE_CREAM_SANDWICH_MR1= 15;public static final intJELLY_BEAN= 16;public static final intJELLY_BEAN_MR1= 17;public static final intJELLY_BEAN_MR2= 18;public static final intKITKAT= 19;}

public static finalString TYPE= getString("ro.build.type");public static finalString TAGS= getString("ro.build.tags");public static finalString FINGERPRINT= getString("ro.build.fingerprint");// The following properties only make sense for internal engineering builds.public static final longTIME= getLong("ro.build.date.utc") * 1000;public static finalString USER= getString("ro.build.user");public static finalString HOST= getString("ro.build.host");public static final booleanIS_DEBUGGABLE=

SystemProperties.getInt("ro.debuggable",0) == 1;public staticString getRadioVersion() {

returnSystemProperties.get(TelephonyProperties.PROPERTY_BASEBAND_VERSION, null);}

private staticString getString(String property) {

returnSystemProperties.get(property,UNKNOWN);}

private static longgetLong(String property) {

try{

returnLong.parseLong(SystemProperties.get(property));} catch(NumberFormatException e) {

return-1;}

}

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/242426
推荐阅读
相关标签
  

闽ICP备14008679号