Build参数一览
Build: 获取当前构建中的系统信息
* MODEL: DesaySV* BOARD: g7ph* BRAND: DesaySV* DEVICE: msmnile_gvmq* DISPLAY: G7PH_T26_PHEV_SOP_03_3993_240229_T* PRODUCT: g7ph_t18p* MANUFACTURER: DesaySV* FINGERPRINT: DesaySV/g7ph_t18p/msmnile_gvmq:11/RQ3A.210805.001.A1/eng.ici2.20240229.153321:userdebug/dev-keys* HARDWARE: qcom* CPU: [arm64-v8a, armeabi-v7a, armeabi]var n1 = Build.BOARD // 主板名称var n2 = Build.BOOTLOADER // 系统引导程序版本号var n3 = Build.BRAND // 系统定制商var n4 = Build.DEVICE // 设备参数var n5 = Build.DISPLAY // 显示屏参数/SOC版本号var n6 = Build.FINGERPRINT // 硬件名var n7 = Build.HARDWARE // 内核命令行中的硬件名/芯片厂商var n8 = Build.ID // 修改版本列表var n9 = Build.MANUFACTURER // 硬件厂商var n10 = Build.MODEL // 版本var n11 = Build.PRODUCT // 手机厂商var n12 = Build.TYPE // Build的类型var n13 = Build.SUPPORTED_ABIS // 支持的ABI类型(CPU架构)
PackageInfo
PackageInfo : 获取应用中包信息,对应从清单文件中读取的信息。
* versionName: T_240228_V1.5.5, 406* sharedUserId: android.uid.system* firstInstallTime: 1709194258000* installLocation: -1* lastUpdateTime: 1711006857387* versionName :版本名称versionCode :版本号packageName : 包名sharedUserId : 共享应用IDfirstInstallTime : 第一次安装时间installLocation:应用程序定义的默认安装位置lastUpdateTime:最近一次安装时间permissions: 清单文件配置的权限activities:清单文件声明的activityLogger.i(TAG, "activities: " + Arrays.toString(packageInfo.activities));// APP iconDrawable icon = packageManager.getApplicationIcon(applicationInfo);
public static PackageInfo getAppVersion(Context context, String packageName) {// 包管理操作管理类PackageManager pm = context.getPackageManager();try {// flags根据需求使用return pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);} catch (PackageManager.NameNotFoundException e) {e.printStackTrace();}return null;}
参考链接
- android Build 硬件参数一览
- Java PackageInfo类代码示例
- Android中的ABI
- Android packageInfo的知识点
- Android开发手册