Code example for OutputStreamWriter

Methods: close, write

0
    	temp2 = temp2.concat(Integer.toString(maxFreq * 1000));
    	temp2 = temp2.concat(" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq\n");
    	 
    	try 
    	{ 
    		writer = new OutputStreamWriter(openFileOutput("temp.sh", 0));
    		writer.write("rmmod cpufreq_stats\n");
    		writer.write(temp);
    		writer.write("sleep 2\n");
    		writer.write("insmod /lib/modules/cpufreq_stats.ko\n");
    		writer.write(temp2);
    		writer.close();
    	}catch(Exception Ignored){}
    	 
    	ShellInterface.runCommand("chmod 777 /data/data/com.shane87.ocapp/files/temp.sh"); 
    	ShellInterface.runCommand("/data/data/com.shane87.ocapp/files/temp.sh"); 
    	ShellInterface.runCommand("rm -f /data/data/com.shane87.ocapp/files/temp.sh"); 
    	 
    	Toast.makeText(this, "Settings Applied!!", Toast.LENGTH_LONG).show();
    	 
    }