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

前端 未结 6 1845
小鲜肉
小鲜肉 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:56

    If you're working with a native application, you should try this:

    #include 
    int GetNumberOfProcessor()
    {
        return sysconf(_SC_NPROCESSORS_CONF);
    }
    

    It work on my i9100 (which availableProcessors() returned 1).

提交回复
热议问题