public static boolean writeLine(String fileName,String value){
  BufferedWriter writer=null;
  try {
    writer=new BufferedWriter(new FileWriter(fileName));
    writer.write(value);
  }
 catch (  FileNotFoundException e) {
    Log.w(TAG,"No such file " + fileName + " for writing",e);
    return false;
  }
catch (  IOException e) {
    Log.e(TAG,"Could not write to file " + fileName,e);
    return false;
  }
 finally {
    try {
      if (writer != null) {
        writer.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return true;
}

public static boolean writeLine ( String fileName , String value ) { BufferedWriter writer = null ; try { writer = new BufferedWriter ( new FileWriter ( fileName ) ) ; writer . write ( value ) ; } catch ( FileNotFoundException e ) { Log . w ( TAG , "No such file " + fileName + " for writing" , e ) ; return false ; } catch ( IOException e ) { Log . e ( TAG , "Could not write to file " + fileName , e ) ; return false ; } finally { try { if ( writer != null ) { writer . close ( ) ; } } catch ( IOException e ) { } } return true ; }
writes the given value into the given file
