user465125
user465125

Reputation: 109

Android How to protect mp3 file from being shared, copied and appear in other music player

I am building a music player in android and downloading mp3 files user has purchased from our store(server).

How can I protect those downloaded music files from being shared, copied from SD card and appear in other music player installed on device. I don’t won’t to encrypt the files as it will take bit processing time.

Many Thanks in advance.

Upvotes: 2

Views: 1151

Answers (1)

aga
aga

Reputation: 29416

One of the options you have is to save your files in the internal storage like so:

// openFileOuput is the public method defined in the Context class
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();

By passing Context.MODE_PRIVATE as the second argument, you're making this file private, so it can be accessed by this app only (or application with the same user ID). I see two issues, though. The first one is that internal storage is usually limited and can't be extended as external storage. The second issue is that AFAIK user still can access private app data on rooted device.

Upvotes: 1

Related Questions