Android: how to write a file to internal storage
Use the below code to write a file to internal storage: public void writeFileOnInternalStorage(Context mcoContext, String sFileName, String sBody){ File dir = new File(mcoContext.getFilesDir(), “mydir”); if(!dir.exists()){ dir.mkdir(); } try { File gpxfile = new File(dir, sFileName); FileWriter writer = new FileWriter(gpxfile); writer.append(sBody); writer.flush(); writer.close(); } catch (Exception e){ e.printStackTrace(); } } Starting in API 19, … Read more