2

I've used many apps that show the speed in MHz on my phone, but where are they getting the information from? I am trying to get the minimum and maximum frequencies of my processor, but am stuck. I've tried reading from:

/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

but, the only folders under cpufreq are "power", "subsystem", "uevent", and "topology".

/sys/devices/system/cpu/cpufreq/

Also has no files.

/proc/cpuinfo

Has a lot of information, but it only shows BogoMIPS instead of both.

Is there elsewhere should be looking or is there some special equation that I need to use in order to calculate it from the data that I do have?

MarkInTheDark
  • 244
  • 2
  • 15

1 Answers1

4

For me,this code works:

String cpuMaxFreq = "";
    RandomAccessFile reader = new RandomAccessFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", "r");
    cpuMaxFreq = reader.readLine();
    reader.close();
Shobhit
  • 1,096
  • 11
  • 30
  • 1
    Thanks, that worked. Oddly enough, it always throws an ENOENT (No such file or directory) on the emulator, but works just fine on my physical device. Do you happen to know what the returned value represents? Is it in Khz, Mhz, is there a conversion I need to perform? – MarkInTheDark Mar 03 '17 at 15:15