Android examples for Hardware:CPU Frequency
get Cpu Frequency
//package com.java2s; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; public class Main { public static String getCpuFre() { String cpuFreFile = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; return ((Long) readLong(cpuFreFile)).toString(); }/*ww w. ja va 2 s . c o m*/ private static long readLong(String file) { RandomAccessFile raf = null; try { raf = getFile(file); return Long.valueOf(raf.readLine()); } catch (Exception e) { return 0; } finally { if (raf != null) { try { raf.close(); } catch (IOException e) { } } } } private static RandomAccessFile getFile(String filename) throws IOException { File f = new File(filename); return new RandomAccessFile(f, "r"); } }