當前位置: 首頁>>代碼示例>>Java>>正文


Java Build.MODEL屬性代碼示例

本文整理匯總了Java中android.os.Build.MODEL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Build.MODEL屬性的具體用法?Java Build.MODEL怎麽用?Java Build.MODEL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.os.Build的用法示例。


在下文中一共展示了Build.MODEL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHandSetInfo

private static String getHandSetInfo() {
    String handSetInfo = "手機型號:" + Build.MODEL
            + "\n係統版本:" + Build.VERSION.RELEASE
            + "\n產品型號:" + Build.PRODUCT
            + "\n版本顯示:" + Build.DISPLAY
            + "\n係統定製商:" + Build.BRAND
            + "\n設備參數:" + Build.DEVICE
            + "\n開發代號:" + Build.VERSION.CODENAME
            + "\nSDK版本號:" + Build.VERSION.SDK_INT
            + "\nCPU類型:" + Build.CPU_ABI
            + "\n硬件類型:" + Build.HARDWARE
            + "\n主機:" + Build.HOST
            + "\n生產ID:" + Build.ID
            + "\nROM製造商:" + Build.MANUFACTURER // 這行返回的是rom定製商的名稱
            ;
    Log.e("tt",handSetInfo);
    return handSetInfo;
}
 
開發者ID:hss01248,項目名稱:MainActivityUIUtil,代碼行數:18,代碼來源:StatusbarUtil.java

示例2: sendFeedback

@Override public void sendFeedback() {
    String body = "\n\n\n\n\n"
            + "Version Code: "
            + BuildConfig.VERSION_CODE
            + '\n'
            + "Version Name: "
            + BuildConfig.VERSION_NAME
            + '\n'
            + "OS API Level: "
            + Build.VERSION.SDK_INT
            + '\n'
            + "Device: "
            + Build.MODEL
            + '\n'
            + '}';
    //body.append("OS Version: ").append(BuildConfig.VERSION_CODE).append('\n');
    //body.append("Model (and Product): ").append(Build.MANUFACTURER).append('\n');
    Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
    sharingIntent.setType("text/plain");
    sharingIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
    sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Feedback");
    sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);
    settingFlowListener.startActivity(Intent.createChooser(sharingIntent, "Choose One"));
}
 
開發者ID:riteshakya037,項目名稱:Subs,代碼行數:24,代碼來源:SettingPresenterImpl.java

示例3: setEditTextDialogContentView

private static Dialog setEditTextDialogContentView(Context context) {
    switch (Adaptation.proportion) {
        case Adaptation.SCREEN_9_16:
            String model = Build.MODEL;
            if(model.contains("m1")||model.contains("M1")){
                return getDialog(context, R.layout.dialog_edit_text_9_16_m1);
            }else {
                return getDialog(context, R.layout.dialog_edit_text_9_16);
            }
        case Adaptation.SCREEN_3_4:
            break;
        case Adaptation.SCREEN_4_3:
            break;
        case Adaptation.SCREEN_16_9:
            return getDialog(context, R.layout.dialog_edit_text_16_9);
    }
    return null;
}
 
開發者ID:teisun,項目名稱:SunmiUI,代碼行數:18,代碼來源:DialogCreater.java

示例4: setTextHintDialogContentView

private static Dialog setTextHintDialogContentView(Context context) {
    switch (Adaptation.proportion) {
        case Adaptation.SCREEN_9_16:
            String modle = Build.MODEL;
            if(modle.contains("m1")||modle.contains("M1")){
                return getDialog(context, R.layout.dialog_text_hint_9_16_m1);
            }else {
                return getDialog(context, R.layout.dialog_text_hint_9_16);
            }
        case Adaptation.SCREEN_3_4:
            return getDialog(context, R.layout.dialog_text_hint_9_16);
        case Adaptation.SCREEN_4_3:
            return getDialog(context, R.layout.dialog_text_hint_4_3);
        case Adaptation.SCREEN_16_9:
            return getDialog(context, R.layout.dialog_text_hint_4_3);
        default:
            return getDialog(context, R.layout.dialog_text_hint_9_16);
    }
}
 
開發者ID:teisun,項目名稱:SunmiUI,代碼行數:19,代碼來源:DialogCreater.java

示例5: getDeviceModel

public static String getDeviceModel() {
  if (isSimulator()) {
    return "Android Emulator";
  }
  String manufacturer = Build.MANUFACTURER;
  String model = Build.MODEL;
  if (model.startsWith(manufacturer)) {
    return capitalize(model);
  } else {
    return capitalize(manufacturer) + " " + model;
  }
}
 
開發者ID:Leanplum,項目名稱:Leanplum-Android-SDK,代碼行數:12,代碼來源:Util.java

示例6: getDeviceName

public static String getDeviceName() {
    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;
    if (model.startsWith(manufacturer)) {
        return CommonUtils.capitalize(model);
    } else {
        return CommonUtils.capitalize(manufacturer) + " " + model;
    }
}
 
開發者ID:afiqiqmal,項目名稱:MVP-Android,代碼行數:9,代碼來源:DeviceUtils.java

示例7: getModel

/**
 * 獲取設備型號,如MI2SC
 */
public static String getModel() {
    String model = Build.MODEL;
    if (model != null) {
        model = model.trim().replaceAll("\\s*", "");
    } else {
        model = "";
    }
    return model;
}
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:12,代碼來源:DeviceUtils.java

示例8: getDeviceInfo

/**
 * 獲取設備信息
 */
public String getDeviceInfo(Context context) {
    return getEmulatorName(context) + "\n" + "Build.PRODUCT: " + Build.PRODUCT + "\n" +
            "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
            "Build.BRAND: " + Build.BRAND + "\n" +
            "Build.DEVICE: " + Build.DEVICE + "\n" +
            "Build.MODEL: " + Build.MODEL + "\n" +
            "Build.HARDWARE: " + Build.HARDWARE + "\n" +
            "Build.FINGERPRINT: " + Build.FINGERPRINT;
}
 
開發者ID:CodyyAndroid,項目名稱:EmulatorDetect,代碼行數:12,代碼來源:EmulatorDetectorService.java

示例9: DefaultInterceptor

public DefaultInterceptor(ConnectivityManager connectivityManager) {
    this.connectivityManager = connectivityManager;
    userAgent = BuildConfig.APPLICATION_ID + "/" + BuildConfig.VERSION_NAME
            + "; Android/" + Build.VERSION.RELEASE
            + "; " + Build.DEVICE
            + "; " + Build.BRAND
            + "; " + Build.MODEL;
}
 
開發者ID:npdess,項目名稱:mining,代碼行數:8,代碼來源:DefaultInterceptor.java

示例10: getDeviceModelNumber

public static String getDeviceModelNumber(Context context) {
    String deviceModel = null;
    try {
        PackageManager pm = context.getPackageManager();
        PackageInfo pi;
        // Version
        pi = pm.getPackageInfo(context.getPackageName(), 0);

        // Device model
        deviceModel = Build.MODEL;
    } catch (PackageManager.NameNotFoundException e) {
        e.printStackTrace();
    }
    return deviceModel;
}
 
開發者ID:NarendraSickarwar,項目名稱:FirebasePost,代碼行數:15,代碼來源:NotifactionUtil.java

示例11: getModel

/**
 * 獲取設備型號
 * <p>如MI2SC</p>
 *
 * @return 設備型號
 */
public static String getModel() {
    String model = Build.MODEL;
    if (model != null) {
        model = model.trim().replaceAll("\\s*", "");
    } else {
        model = "";
    }
    return model;
}
 
開發者ID:tututututututu,項目名稱:BaseCore,代碼行數:15,代碼來源:DeviceUtils.java

示例12: getUserAgent

/**
 * User-Agent: Mozilla/5.0 (Linux; U; Android 5.0.2; zh-cn; Redmi Note 3 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36
 */
public static String getUserAgent() {
    if (TextUtils.isEmpty(userAgent)) {
        String webUserAgent = null;
        try {
            Class<?> sysResCls = Class.forName("com.android.internal.R$string");
            Field webUserAgentField = sysResCls.getDeclaredField("web_user_agent");
            Integer resId = (Integer) webUserAgentField.get(null);
            webUserAgent = EasyHttp.getContext().getString(resId);
        } catch (Exception e) {
            // We have nothing to do
        }
        if (TextUtils.isEmpty(webUserAgent)) {
            webUserAgent = "Mozilla/5.0 (Linux; U; Android %s) AppleWebKit/533.1 (KHTML, like Gecko) Version/5.0 %sSafari/533.1";
        }

        Locale locale = Locale.getDefault();
        StringBuffer buffer = new StringBuffer();
        // Add version
        final String version = Build.VERSION.RELEASE;
        if (version.length() > 0) {
            buffer.append(version);
        } else {
            // default to "1.0"
            buffer.append("1.0");
        }
        buffer.append("; ");
        final String language = locale.getLanguage();
        if (language != null) {
            buffer.append(language.toLowerCase(locale));
            final String country = locale.getCountry();
            if (!TextUtils.isEmpty(country)) {
                buffer.append("-");
                buffer.append(country.toLowerCase(locale));
            }
        } else {
            // default to "en"
            buffer.append("en");
        }
        // add the model for the release build
        if ("REL".equals(Build.VERSION.CODENAME)) {
            final String model = Build.MODEL;
            if (model.length() > 0) {
                buffer.append("; ");
                buffer.append(model);
            }
        }
        final String id = Build.ID;
        if (id.length() > 0) {
            buffer.append(" Build/");
            buffer.append(id);
        }
        userAgent = String.format(webUserAgent, buffer, "Mobile ");
        return userAgent;
    }
    return userAgent;
}
 
開發者ID:zhou-you,項目名稱:RxEasyHttp,代碼行數:59,代碼來源:HttpHeaders.java

示例13: getDeviceName

/**
 * 獲取設備的型號
 */
public static String getDeviceName() {
    String model = Build.MODEL;
    return model;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:DeviceUtils.java

示例14: getPhoneType

public static String getPhoneType() {
    return Build.MODEL;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:3,代碼來源:DeviceUtils.java

示例15: getUserAgent

/**
 * User-Agent: Mozilla/5.0 (Linux; U; Android 5.0.2; zh-cn; Redmi Note 3 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36
 */
public static String getUserAgent() {
    if (TextUtils.isEmpty(userAgent)) {
        String webUserAgent = null;
        try {
            Class<?> sysResCls = Class.forName("com.android.internal.R$string");
            Field webUserAgentField = sysResCls.getDeclaredField("web_user_agent");
            Integer resId = (Integer) webUserAgentField.get(null);
            webUserAgent = OkGo.getInstance().getContext().getString(resId);
        } catch (Exception e) {
            // We have nothing to do
        }
        if (TextUtils.isEmpty(webUserAgent)) {
            webUserAgent = "okhttp-okgo/jeasonlzy";
        }

        Locale locale = Locale.getDefault();
        StringBuffer buffer = new StringBuffer();
        // Add version
        final String version = Build.VERSION.RELEASE;
        if (version.length() > 0) {
            buffer.append(version);
        } else {
            // default to "1.0"
            buffer.append("1.0");
        }
        buffer.append("; ");
        final String language = locale.getLanguage();
        if (language != null) {
            buffer.append(language.toLowerCase(locale));
            final String country = locale.getCountry();
            if (!TextUtils.isEmpty(country)) {
                buffer.append("-");
                buffer.append(country.toLowerCase(locale));
            }
        } else {
            // default to "en"
            buffer.append("en");
        }
        // add the model for the release build
        if ("REL".equals(Build.VERSION.CODENAME)) {
            final String model = Build.MODEL;
            if (model.length() > 0) {
                buffer.append("; ");
                buffer.append(model);
            }
        }
        final String id = Build.ID;
        if (id.length() > 0) {
            buffer.append(" Build/");
            buffer.append(id);
        }
        userAgent = String.format(webUserAgent, buffer, "Mobile ");
        return userAgent;
    }
    return userAgent;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:59,代碼來源:HttpHeaders.java


注:本文中的android.os.Build.MODEL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。