如何以编程方式获取Android的固件版本? [英] How to obtain Firmware version of Android programmatically?

查看:1024
本文介绍了如何以编程方式获取Android的固件版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下通用平板电脑的屏幕截图显示了固件版本的示例:

The following screenshot of a generic tablet shows an example of Firmware version:

我们已经尝试了 Android Build 的几乎所有内容,其中是固件版本.

We have tried pretty much everything of Android Build, none of them is the firmware version.

推荐答案

固件是可在Android设备上使用的操作软件,并且它具有不同制造商设计的不同版本.基本上,这是软件的特定于设备的部分.例如,您的手机上可能运行的是Android 4.2.2,但固件号看起来却完全不同,因为它涉及的不仅仅是操作系统,还涉及更多详细信息.固件编号由几个元素组成,所有这些元素对于手机的功能都是必不可少的:

Firmware is the operating software available on an Android device, and it is available in different versions designed by different manufacturers. Basically it's the device-specific part of the software. For example, you may have Android 4.2.2 running on your phone, but have a firmware number that looks completely different because it relates to more details than just Operating System. The firmware number consists of several elements, all of which are essential for the functioning of the phone:

PDA:Android操作系统和您的自定义设置. 电话:设备的实际标识符. CSC(国家/地区退出代码):语言和特定于国家/地区的参数. Bootloader:引导加载程序,在启动时会运行到所有单元进程.

PDA: Android operating system and your customizations. Phone: the actual identifier of your device. CSC (Country Exit Code): the languages and country-specific parameters. Bootloader: the boot loader program that runs at startup to all unit processes.

软件内部版本基本上是固件版本.

请参阅android.os.Build.VERSION. SDK或SDK中包含API版本. android.os.Build.VERSION_CODES包含相关的常量.

See android.os.Build.VERSION. SDK or SDK in contain the API version. android.os.Build.VERSION_CODES contains the relevant constants.

String deviceSoftwareVersion=telephonyManager.getDeviceSoftwareVersion();

请参阅此 Build.VERSION

在代码中使用它的过程.

Procedure to use it in code.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
     // only for gingerbread and newer versions
}

这也可以通过代码进行检查

This can be also checked by through code

System.out.println("button press on device name = "+android.os.Build.MODEL +" brand = "+android.os.Build.BRAND +" OS version = "+android.os.Build.VERSION.RELEASE + " SDK version = " +android.os.Build.VERSION.SDK_INT);

更新

尝试这个-

  1. android.os.Build.FINGERPRINT
  2. android.os.Build.BOARD
  3. Build.HOST
  4. Build.ID
  1. android.os.Build.FINGERPRINT
  2. android.os.Build.BOARD
  3. Build.HOST
  4. Build.ID

  1. Build.SERIAL
  1. Build.SERIAL

检查以下代码.

最终更新

String mString = "";

    mString.concat("VERSION.RELEASE {" + Build.VERSION.RELEASE + "}");
    mString.concat("\nVERSION.INCREMENTAL {" + Build.VERSION.INCREMENTAL + "}");
    mString.concat("\nVERSION.SDK {" + Build.VERSION.SDK + "}");
    mString.concat("\nBOARD {" + Build.BOARD + "}");
    mString.concat("\nBRAND {" + Build.BRAND + "}");
    mString.concat("\nDEVICE {" + Build.DEVICE + "}");
    mString.concat("\nFINGERPRINT {" + Build.FINGERPRINT + "}");
    mString.concat("\nHOST {" + Build.HOST + "}");
    mString.concat("\nID {" + Build.ID + "}");

    ((TextView) findViewById(R.id.textView1)).setText(mString);

您也可以使用Build.DISPLAY

用于向用户显示的构建ID字符串

A build ID string meant for displaying to the user

这篇关于如何以编程方式获取Android的固件版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆