Sagar Zala
Sagar Zala

Reputation: 5134

Download Audio file like Gaana Android app

I have created an Android Application, in that I am playing and downloading audio file from server. So when user download audio file from server he/she can't show that file in File Manager or any other media player like Gaana app.

How to make it possible?

Thanks,

Sagar.

Upvotes: 0

Views: 932

Answers (2)

Vladyslav Matviienko
Vladyslav Matviienko

Reputation: 10881

You can use few approaches:

  1. Download files into the private application's directory. No other apps will have access to those files. Pros of this approach is that is is the easiest way. Cons is that the inner storage might be limited in the device.
  2. Download files saving them with incorrect file extensions. Pros: easy to implement, can save anywhere. Cons: files can be accessed, copied and renamed by any other app.
  3. The same way as 2nd approach, but add some encryption to the files, so nobody except you can use them. This approach might require on-the-fly decryption.

Upvotes: 1

Shadow Droid
Shadow Droid

Reputation: 1696

You can save the files in Internal Storage Area. These files would be private to your app only.
Using getFilesDir() on any context provides absolute path to the filesystem directory where your internal files are saved. There in you can create directory. For more information refer here

Upvotes: 1

Related Questions