Code example for BufferedReader

Methods: close, readLine

0
		 
	public int vibrateStatus() { 
		String value;
		try { 
	    	FileReader input = new FileReader("/sys/module/synaptics_i2c_rmi_1564/parameters/vibrate");
	    	BufferedReader reader = new BufferedReader(input);
	    	value = reader.readLine();
	    	reader.close();
	    	input.close();
	    	 
		} catch (Exception e) {
			Log.d("X5 Settings", "Unexpected error: "+e.getMessage());
			return 0; 
		} 
	    if(value == null) return 0;
	    else return Integer.parseInt(value);
	} 
}