# android-device **Repository Path**: jingtuo/android-device ## Basic Information - **Project Name**: android-device - **Description**: 一款用于收集和查询设备信息的应用,基于华为云数据库实现数据管理 - **Primary Language**: Kotlin - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-10 - **Last Updated**: 2024-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Android-设备数据 一款用于收集和查询设备信息的应用 ## 技术原理 1. 基于android.os.Build获取常规的设备信息 2. 基于getprop命令获取非常规的设备信息, 如: 设备名称 > android.os.SystemProperties可以获取单个属性的值, 但未提供获取所有属性的API, 所以使用getprop命令获取所有属性 ## 验证设备 - [荣耀 X40](device/荣耀_X40.properties) - [Redmi Note 12 Turbo](device/Redmi_Note_12_Turbo.properties) - [vivo S10 Pro](device/vivo_S10_Pro.properties) - [nova 10 SE](device/nova_10_SE.properties) - [Xiaomi Pad 5 Pro](device/Xiaomi_Pad_5_Pro.properties) ## Compose ### 问题 1. Icon、Image不支持webp ```text Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG ``` 2. 组件崩溃不易排查 ```text FATAL EXCEPTION: main Process: io.gitee.jingtuo.android.device.data, PID: 12711 java.lang.IndexOutOfBoundsException: Index: 7, Size: 7 at java.util.ArrayList.get(ArrayList.java:437) at io.gitee.jingtuo.android.device.info.ui.search.prop.SearchPropPageKt$SearchPropPage$2$1$1$invoke$$inlined$items$default$3.invoke(LazyDsl.kt:147) at io.gitee.jingtuo.android.device.info.ui.search.prop.SearchPropPageKt$SearchPropPage$2$1$1$invoke$$inlined$items$default$3.invoke(LazyDsl.kt:144) at androidx.compose.foundation.lazy.layout.LazyLayoutIntervalContent.getContentType(LazyLayoutIntervalContent.kt:49) at androidx.compose.foundation.lazy.LazyListItemProviderImpl.getContentType(LazyListItemProvider.kt:87) at androidx.compose.foundation.lazy.LazyListMeasuredItemProvider.getAndMeasure(LazyListMeasuredItemProvider.kt:47) at androidx.compose.foundation.lazy.LazyListMeasureKt.measureLazyList-5IMabDg(LazyListMeasure.kt:195) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke-0kLqBqw(LazyList.kt:313) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(LazyList.kt:178) at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke-0kLqBqw(LazyLayout.kt:107) at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke(LazyLayout.kt:100) ``` 3. LazyColumn加载列表, 当item之间存在高度差异的时候, 滑动过程中会出现错位, 出现错位的组件滑出屏幕再滑入屏幕恢复正常 ## 参考资料 - [Jetpack Compose Doc](https://developer.android.google.cn/jetpack/compose/documentation?hl=zh-cn) - [Material3](https://developer.android.google.cn/reference/kotlin/androidx/compose/material3/package-summary.html) - [Coroutines on Android](https://developer.android.google.cn/kotlin/coroutines?hl=en) - [ViewModel and State in Compose](https://developer.android.google.cn/codelabs/basic-android-kotlin-compose-viewmodel-and-state?hl=en#0)