public static void writeToFile(String string,boolean isAppend){
  String path=Environment.getExternalStorageDirectory() + File.separator + MYTRACKS_TEST_INFO_FILE;
  try {
    FileOutputStream fileOutputStream=new FileOutputStream(new File(path),isAppend);
    OutputStreamWriter osw=new OutputStreamWriter(fileOutputStream);
    try {
      osw.write(string);
    }
  finally {
      osw.flush();
      osw.close();
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"Meet error when write test info to file.",e);
  }
  return;
}

public static void writeToFile ( String string , boolean isAppend ) { String path = Environment . getExternalStorageDirectory ( ) + File . separator + MYTRACKS_TEST_INFO_FILE ; try { FileOutputStream fileOutputStream = new FileOutputStream ( new File ( path ) , isAppend ) ; OutputStreamWriter osw = new OutputStreamWriter ( fileOutputStream ) ; try { osw . write ( string ) ; } finally { osw . flush ( ) ; osw . close ( ) ; } } catch ( Exception e ) { Log . e ( TAG , "Meet error when write test info to file." , e ) ; } return ; }
writes a string to battery info file . this method would add a time string before the given value .
