My question is how do I create files and folders that can be viewed and accessed on computers later. In my code in the project I have a method that creates a text file.
public void criaArquivo() {
File file = new File (Envoiment.getExternalStoragePublicDirectory("/") + "/testes/TextoFiles.txt");
FileOutputStream outputStream;
try {
outputStream = new FileOutputStream (file);
outputStream.write("string".getBytes());
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
Well, so far so good it creates a .txt file there
/storage/emulated/0/testes/TextoFile.txt
I verify this using my file managers from my Android. It happens that when I open the PC via USB, enabling MTP appears all the other folders that have in that directory, the
/ storage / emulated / 0 /
except what I just created. Why?