public static boolean saveStringToFile(String dataInput,String path){
  String filename=path;
  File file=new File(filename);
  FileOutputStream fos;
  byte[] data=dataInput.getBytes();
  try {
    fos=new FileOutputStream(file);
    fos.write(data);
    fos.flush();
    fos.close();
    return true;
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return false;
}

public static boolean saveStringToFile ( String dataInput , String path ) { String filename = path ; File file = new File ( filename ) ; FileOutputStream fos ; byte [ ] data = dataInput . getBytes ( ) ; try { fos = new FileOutputStream ( file ) ; fos . write ( data ) ; fos . flush ( ) ; fos . close ( ) ; return true ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return false ; }
save string to file
