L
L
LittleBob2022-03-16 21:03:00
Java
LittleBob, 2022-03-16 21:03:00

How to save file to android internal storage via code?

With this code, I save a txt file along the path Android\data\myApp\files\myFileTxt

private File getExternalPath() {
        return new File(getExternalFilesDir(null), editName.getText().toString());
    }

public void saveTxt(){
 try(FileOutputStream fos = new FileOutputStream(getExternalPath())) {}catch(IOException ex) {}
}


How can I save the file immediately to the internal storage so that I don't have to climb so far?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Hrebeniuk, 2022-03-16
@denis-hrebeniuk

As far as I know, starting with Android 11, Google has limited storage. You can see more details here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question