Reputation: 183
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
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.
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