How can you detect a dual-core cpu on an Android device from code?

前端 未结 6 1823
小鲜肉
小鲜肉 2020-11-29 23:42

I\'ve run into a problem that appears to affect only dual-core Android devices running Android 2.3 (Gingerbread or greater. I\'d like to give a di

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 23:50

    This is pretty simple.

    int numberOfProcessors = Runtime.getRuntime().availableProcessors();
    

    Typically it would return 1 or 2. 2 would be in a dual-core CPU.

提交回复
热议问题