Can I create password protected folder in Android?

后端 未结 2 1415
我在风中等你
我在风中等你 2020-12-11 13:56

I would like to create a folder which is password protected. I am able to create a folder in the following way, but how can I create a password protected folder?

<         


        
相关标签:
2条回答
  • 2020-12-11 14:19
    • in android there is not possible but we can hide using "." at prefix
    • otherwise Store important folder or file in internal memory.
    • you can see you package directory following way String dir = getPackageManager().getPackageInfo("com.example.kinkey", 0).applicationInfo.dataDir;

    Note: it is visible on windows pc

    0 讨论(0)
  • 2020-12-11 14:30

    You can't create such a folder on sdcard. Everything that's saved onto sdcard can be accessed by other applications. If you want to create a folder which is not accessible from outside of your application use Context.getDir() method with mode set to MODE_PRIVATE:

    Context ctx = getContext();
    File folder = ctx.getDir("NewFolder", Context.MODE_PRIVATE);
    
    0 讨论(0)
提交回复
热议问题