Is there any API that tells whether an Android device is dual-core or not?
<p>I am doing dual core optimization by multi-threading, and it works like this:
If the device has dual-core processor, two threads are created to do the computation, and if the device has only one-core processor, only one thread is created to do the computation.</p>

<p>My question is: how does my program know whether a device is dual-core or not?
I just want to have one program that can run on both dual-core and one-core devices, so it has to be able to know that information.</p>

<p>code like this:</p>

<pre><code>    if( xxx_API_is_device_dual_core() )  // Inside if() is the expected API
    {
     saveThread = new SaveThread[2];
    }
    else
    {
    saveThread = new SaveThread[1];
    }
</code></pre>

<p>Thank you very much for any help!</p>
