1. //获得CPU最小赫兹 
  2. public static double getCpuMinFreq() 
  3.     double cpuMinFreq = 0
  4.     try 
  5.     { 
  6.         BufferedReader br = new BufferedReader(new FileReader("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq")); 
  7.         String text = ""
  8.         while ((text = br.readLine()) != null
  9.         { 
  10.             text  = text.trim(); 
  11.             if (!"".equals(text.trim())) 
  12.             { 
  13.                 cpuMinFreq = Double.parseDouble(text.trim()) / 1000;  
  14.                 DeviceUtil.cpuMinFreq = cpuMinFreq; 
  15.             } 
  16.             break
  17.         } 
  18.         br.close(); 
  19.         br = null
  20.     } 
  21.     catch(Exception e) 
  22.     { 
  23.         //MyLog.d(e.toString()); 
  24.     } 
  25.     return cpuMinFreq; 

 

 
  
  1. //获得CPU最大赫兹 
  2. public static double getCpuMaxFreq() 
  3.     double cpuMaxFreq = 0
  4.     try 
  5.     { 
  6.         BufferedReader br = new BufferedReader(new FileReader("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")); 
  7.         String text = ""
  8.         while ((text = br.readLine()) != null
  9.         { 
  10.             text  = text.trim(); 
  11.             if (!"".equals(text.trim())) 
  12.             { 
  13.                 cpuMaxFreq = Double.parseDouble(text.trim()) / 1000
  14.                 DeviceUtil.cpuMaxFreq = cpuMaxFreq; 
  15.             } 
  16.             break
  17.         } 
  18.         br.close(); 
  19.         br = null
  20.     } 
  21.     catch(Exception e) 
  22.     { 
  23.         //MyLog.d(e.toString()); 
  24.     } 
  25.     return cpuMaxFreq;