如何获得Android上的处理器数量

问题描述:

大家好,我想在Android处理器编号。我可以这样做如下:

Hi all, I want to get the processor number on android. can I do that like as follow:

int processporNum =  sysconf(_SC_NPROCESSORS_CONF);

但每次返回值是1对我的一些手机,所以我不知道这methold是正确的。是有电气特性的API,可以得到这样的信息

but everytime the return value is 1 on some of my phones, so i not sure this methold is right .is there anyother api can get this info

您可以运行

Runtime.getRuntime().availableProcessors()