简体   繁体   English

可以在Android中创建受密码保护的文件夹吗?

[英]Can it possible to create password protected folder in Android?

Can I create password protected folder in Android? 我可以在Android中创建受密码保护的文件夹吗?

 File nf = new File("Folder");
    nf.mkDire();

First, new File("Folder") has no meaning in Android. 首先, new File("Folder")在Android中没有任何意义。 Always use some method to get at a root location, whether that is for internal storage or external storage . 无论内部存储还是外部存储 ,请始终使用某种方法来获取根位置。

Second, you cannot create a password-protected folder in Android at the OS level. 其次,您无法在操作系统级别的Android中创建受密码保护的文件夹。 You are welcome to store files in internal storage, in which case they are only accessible via your app, which can require a password (exception: people who root their devices can get at the files directly). 欢迎您将文件存储在内部存储中,在这种情况下,只能通过您的应用访问这些文件,而这可能需要输入密码(例外:拥有设备根目录的人可以直接获取文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM