androiddownloadpodcast

Download mp3 for offline use in android studio


I am making a podcast app in android studio and i want to be able to download the different episodes so the user can listen to them when being offline. Pretty much like spotify. But i don't want to download them to the public user storage, instead i want to download them in an internal app storage, if such thing exists. The DownloadManager documentation from android wasn't any help. Hope you can help me :D


Solution

  • Check out the Android data-storage developer docs here Android data-storage developer docs and specifically check out the Internal storage directories and Access persistent files parts.

    You can use context.getFilesDir() to "get a file representing an internal directory for your app" so you should be able to use this to create a private storage location to save your podcast files to which other apps cannot access.