Get the number of processor cores available to the VM

The method Runtime.availableProcessors() returns the number of processor cores available to the VM, at least 1. Traditionally this returned the number currently online, but many mobile devices are able to take unused cores offline to save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of cores that could be made available if there were no power or heat constraints.


import android.os.Bundle;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {

int availableProcessors = Runtime.getRuntime().availableProcessors();
“Available Processors: ” + availableProcessors,

Android Coding

betting sites