我将视频和图像保存在一个文件夹中..现在我想将此文件夹设置为受密码保护,这意味着在打开此文件夹时需要输入密码才能查看其中的文件,
希望在这里能得到任何相关的答案。 .如果还有其他可能的请建议..
try {
dirName = "/mydirectory/";
fileName = new Long(
SystemClock.currentThreadTimeMillis())
.toString()
+ ".png";
} catch (NullPointerException e) {
// TODO: handle exception
}
try {
if (android.os.Environment
.getExternalStorageState()
.equals(android.os.Environment.MEDIA_MOUNTED)) {
File sdCard = Environment
.getExternalStorageDirectory();
File dir = new File(sdCard.getAbsolutePath()
+ dirName);
dir.mkdirs();
File file = new File(storedImagePath);
os = new FileOutputStream(file, true);
byte[] byteArray = receivedImageData.getBytes();
byteArray = Base64.decode(byteArray, 0);
os.write(byteArray);
os.flush();
os.close();
} else {
}
} catch (Exception e) {
}