how to query android device hardware info

非 Y 不嫁゛ 提交于 2020-01-05 08:11:21

问题


how can i get android device hardware info like CPU arch, speed, neon, GPU , name, manufacturer, RAM size. i hope there is a way to do that natively using ndk , but if it is possible only by java code than how to do that.


回答1:


You need to user Build class for your requirement. The Build class will provide you information like Android Version, Display, Manufacture etc.

Build.BOARD
Build.BRAND
Build.CPU_ABI
Build.DEVICE
Build.DISPLAY
Build.HOST
Build.ID
Build.MANUFACTURER
Build.MODEL
Build.PRODUCT
Build.TAGS
Build.TYPE
Build.USER

Also visit this example.




回答2:


For android method you can start by importing android.os.Build then use one of the many constants found within the library. Essentially this uses data from build.prop file. so for ndk you may try to read the /system/build.prop file.

note that not all manufacturers allow you to read this values.

check this site: http://developer.android.com/reference/android/os/Build.html

edit: like the answer below...



来源:https://stackoverflow.com/questions/11497319/how-to-query-android-device-hardware-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!