Protected folder in memory

How can I protect all content downloaded by the application? These files should be accessible only for this separate application and cannot be copied / viewed by any other application or USB cable.

+4
source share
3 answers

You can store your files in internal memory. Try the following code

File myFolder = context.getDir("DirectoryName", Context.MODE_PRIVATE); //Create folder in internal memory;
File myFile = new File(myFolder, "fileName"); //Create file inside the folder.
FileOutputStream ouStreamt = new FileOutputStream(myFile);

Use ouStreamt to write your content to a file. Hope this helps you.

+1
source
+1

You can implement the encrytion \ dercyption file, if this is really necessary - a link . But in most cases, the internal storage will be quite safe.

+1
source

Source: https://habr.com/ru/post/1568720/


All Articles