热门IT资讯网

获得手机硬件信息

发表于:2024-11-30 作者:热门IT资讯网编辑
编辑最后更新 2024年11月30日,关键类:android.os.Build.*如果需要针对不同手机品牌做适配,可以通过手机厂商(Manufacturer)信息做代码控制,更精确一些可以使用型号(Model),Model可以更精确指向一

关键类:android.os.Build.*

如果需要针对不同手机品牌做适配,可以通过手机厂商(Manufacturer)信息做代码控制,更精确一些可以使用型号(Model),Model可以更精确指向一款手机。

下面记录我手里的几台手机的信息:
可见Product和Device获取的信息也不太稳定,如红米3得到的都是ido。

魅蓝Note5

ID:              NRD90MDISPLAY:         Flyme 6.3.0.2APRODUCT:         meizu_M5 NoteDEVICE:          M5NoteBOARD:           M5 NoteMANUFACTURER:    MeizuBRAND:           MeizuMODEL:           M5 NoteHARDWARE:        mt6755SERIAL:          RELEASE:         7.0SDK_INT:         24SUPPORTED_ABIS:         [arm64-v8a, armeabi-v7a, armeabi]SUPPORTED_32_BIT_ABIS:  [armeabi-v7a, armeabi]SUPPORTED_64_BIT_ABIS:  [arm64-v8a]

一加5T

ID:              OPR6.170623.013DISPLAY:         ONEPLUS A5010_43_180315PRODUCT:         OnePlus5TDEVICE:          OnePlus5TBOARD:           msm8998MANUFACTURER:    OnePlusBRAND:           OnePlusMODEL:           ONEPLUS A5010HARDWARE:        qcomSERIAL:          RELEASE:         8.0.0SDK_INT:         26SUPPORTED_ABIS:         [arm64-v8a, armeabi-v7a, armeabi]SUPPORTED_32_BIT_ABIS:  [armeabi-v7a, armeabi]SUPPORTED_64_BIT_ABIS:  [arm64-v8a]

红米3

ID:              LMY47VDISPLAY:         LMY47VPRODUCT:         idoDEVICE:          idoBOARD:           msm8916MANUFACTURER:    XiaomiBRAND:           XiaomiMODEL:           Redmi 3HARDWARE:        qcomSERIAL:          RELEASE:         5.1.1SDK_INT:         22SUPPORTED_ABIS:         [arm64-v8a, armeabi-v7a, armeabi]SUPPORTED_32_BIT_ABIS:  [armeabi-v7a, armeabi]SUPPORTED_64_BIT_ABIS:  [arm64-v8a]

红米note2

ID:              LRX22GDISPLAY:         LRX22GPRODUCT:         hermesDEVICE:          hermesBOARD:           unknownMANUFACTURER:    XiaomiBRAND:           XiaomiMODEL:           Redmi Note 2HARDWARE:        mt6795SERIAL:          RELEASE:         5.0.2SDK_INT:         21SUPPORTED_ABIS:         [arm64-v8a, armeabi-v7a, armeabi]SUPPORTED_32_BIT_ABIS:  [armeabi-v7a, armeabi]SUPPORTED_64_BIT_ABIS:  [arm64-v8a]

Samsung Galaxy Core Prime(SM-G3608)

ID:              KTU84PDISPLAY:         KTU84P.G3608ZMU1AOH2PRODUCT:         rossaltezmDEVICE:          rossalteBOARD:           MSM8916MANUFACTURER:    samsungBRAND:           samsungMODEL:           SM-G3608HARDWARE:        qcomSERIAL:          RELEASE:         4.4.4SDK_INT:         19
Log.i(TAG, "ID:              " + Build.ID);Log.i(TAG, "DISPLAY:         " + Build.DISPLAY);Log.i(TAG, "PRODUCT:         " + Build.PRODUCT);Log.i(TAG, "DEVICE:          " + Build.DEVICE);Log.i(TAG, "BOARD:           " + Build.BOARD);Log.i(TAG, "MANUFACTURER:    " + Build.MANUFACTURER);Log.i(TAG, "BRAND:           " + Build.BRAND);Log.i(TAG, "MODEL:           " + Build.MODEL);Log.i(TAG, "HARDWARE:        " + Build.HARDWARE);Log.i(TAG, "SERIAL:          " + Build.SERIAL);Log.i(TAG, "RELEASE:         " + Build.VERSION.RELEASE);Log.i(TAG, "SDK_INT:         " + Build.VERSION.SDK_INT);Log.i(TAG, "SUPPORTED_ABIS:         " + Arrays.asList(Build.SUPPORTED_ABIS));Log.i(TAG, "SUPPORTED_32_BIT_ABIS:  " + Arrays.asList(Build.SUPPORTED_32_BIT_ABIS));Log.i(TAG, "SUPPORTED_64_BIT_ABIS:  " + Arrays.asList(Build.SUPPORTED_64_BIT_ABIS));
    @Override    protected void onStart() {        super.onStart();        EventBus.getDefault().register(this);    }    @Override    protected void onStop() {        super.onStop();        EventBus.getDefault().unregister(this);    }
0