Search code examples
androidfileruntimeinternal-storage

Download Files To Internal Storage


I am having some trouble with my application.

I wanted to download the files and then save them into my apps drawable folder, but since that is not an option because app is read only, I want to save the downloaded file into internal storage so that only my app can access them.
If I cannot directly download the file to internal storage, can I read from downloads folder and then save it to internal storage?

Either way, I have the download method, I just need to know where to save the downloaded file and how to access it at runtime and persistently store it in internal storage.


Solution

  • Try having a look at

    _context.getFilesDir();
    

    and

    _context.getExternalFilesDir();