Getting Processor Hardware Name of android device -


i execute /proc/cpuinfo details of cpu in android device using below code.

        try {             process proc = runtime.getruntime().exec("cat /proc/cpuinfo");             inputstream = proc.getinputstream();             textview tv = (textview)rootview.findviewbyid(r.id.textview1);             tv.settext(getstringfrominputstream(is));         }          catch (ioexception e) {             log.e("tag", "------ getcpuinfo " + e.getmessage());         } 

within returns hardware name. hardware name not in proper readable format. have tested in various devices samsung note 3, micromax canvas doodle a111, micromax turbo a250.

this in these devices respectively:

  • samsung exynos5420 : (but need name samsung exynos octa 5420 )
  • qrd msm8625q evbd : (need name qualcomm snapdragon 200 )
  • mt6589 : ( mediatek mt6589 )

how can overcome this, please !!!

it seems bit unclear me if cpu capabilities or device information in general, anyway...

android provides nice little class called build gets quite bit of information directly via static fields of class. class provides lot of device-level information shown below:

taken directly htc 1 m8 (some fields omitted):

build.board: msm8974 build.bootloader: 3.19.0.0000 build.brand: htc build.device: htc_m8 build.display: cm_m8-userdebug 5.1.1 lmy47v 47d6aee9c3 test-keys build.hardware: qcom build.manufacturer: htc build.model: 1 m8 build.product: cm_m8 

from looks of build.brand + " " + build.model looks want.

whilst docs doesn't guarantee standardization field, better calling runtime.exec("cat /proc/cpuinfo") , parsing there.

if cpu level capabilities want, can try doing native code using android cpufeatures library, calling function:

uint64_t android_getcpufeatures(); 

to int containing many cpu feature flags.


Comments