开发者

Secure path in Android FileSystem?

开发者 https://www.devze.com 2023-03-30 14:28 出处:网络
I want to save my Android Application images and their details files in some secure path (so that any Android Application user can\'t access that files or you can say that it should be hidden to the U

I want to save my Android Application images and their details files in some secure path (so that any Android Application user can't access that files or you can say that it should be hidden to the User).

Can Anyone 开发者_C百科Help me...


If the device is rooted, the user will have an access to any file. If not, you can use internal storage.

Accessing the chache or files folder is done using the Context. the context can be your activity (activity extends context), and if you want to access the directory from a class which is not your activity / service you will need to pass a reference of the activity to this class.

Short example:

File chacheDir = myActivity.getCacheDir();


Create a folder with start with "."filename(ignore quotes) this will be always hidden to the user since android is linux based file system. you can store all your image into that folder.

0

精彩评论

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

关注公众号