开发者

Hiding videos on android sd card

I am playing videos locally from sd card in listview in an android app. Now i want t开发者_如何学运维o hide those videos from user so that he can only play those videos but should not locate those videos to copy from sd card. Is there any way to hide videos on sd card?


You cannot prevent access to files on external storage.

You can encrypt those videos so that only you can decrypt & play them.


No. Nothing prevents from the user rummaging around the SD card themselves either by ejecting and plugging into another machine, or putting the phone into mass storage/mtp mode. If you don't want the user to get their hands on the video, then don't store the video on the phone.


Storing on internal storage with Private permissions will at least keep the video only in your app.

http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

String FILENAME = "hello_file";
String string = "hello world!";

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜