lou
lou

Reputation: 183

video download on android that can only be played from the app

my app is streaming videos from url, but I'd also like to be able to download them and see them offline.

Is it possible to make them available just for my app?

These videos should not be shared or transfered to other devices, they should be played from the app that downloaded them only.

Upvotes: 1

Views: 406

Answers (1)

Philip Liberato
Philip Liberato

Reputation: 331

You'll want to use Internal Storage to store the data in a private folder on the device that only your app can access.

Example

String FILENAME = "My File Name";
YourVideoDataType video;
FileOutputStream fOutputStream = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fOutputStream.write(video.getBytes());
fOutputStream.close();

Also, make sure to include the WRITE_EXTERNAL_STORAGE permission in your Android Manifest.

Upvotes: 2

Related Questions