问题
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