He is my code:
File f; FileInputStream inputStream; byte[] buffer = null; try { f=new File("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"); if(f.exists()){ inputStream = new FileInputStream(f); inputStream.read(buffer); } Log.i("informacja","Czytam"); } catch (Exception e) { // TODO Auto-generated catch block Log.i("informacja",e.toString()); } File path is correct, File exists. But always in inputStream.read(buffer) i get NullPointerException. This is part of my Manifest:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> Can anyone suggest me where I made a mistake?
@Update. Thanks for the code snippet. Now i can read but: this is what I get : [B@41a743c8 What I should get: 1000000