Hello, in my app I download a CSV file, but it never appears in the Downloads of the smartphone, I can only see if it is with the File Manager. And also when I try to pass the file to the computer, I can not find the directory that was saved. The file path is this /storage/emulated/0/Download/16hrs.csv . How do I show the file on my smartphone downloads and how do I get this file from my computer? obg
private File getStorageDir(String fileName) {
return new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS), fileName);
}
File f = getStorageDir(fileName);
FileWriter mFileWriter = null;
mFileWriter = new FileWriter(filePath , true);
writer = new CSVWriter(mFileWriter,';',' ');
String[] dTitle = {"Academia","Data", "Turma","Aluno","Piscinas","Metros","Tempo"};
writer.writeNext(dTitle);
writer.close();
mFileWriter.close();