i am saving video and image in a folder ..now i want to make this folder as password protected , means while opening this folder needs to enter a password for view the file inside it
hope here ill get any relevant answer for doing this...if there some any other possible please suggest..
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) {
}
Step 1: Open the Settings app and tap Biometrics and Security. Step 2: Scroll down and select Encrypt or on Encrypt SD Card. Step 3: Tap on Encrypt SD Card. Step 4: Enter your Pin, Pattern, or Password and proceed.
Navigate to and open an app with files, such as Gallery. Tap and hold the file(s) you want to move into Secure Folder. Tap More and then tap Move to Secure Folder. The file will be moved and you can view it in Secure Folder.
I'd like to suggest a different/feasible approach, Encrypt your file!
Look at this answer!
Even if you are successful in implementing a password protection (Wow!) here are the cons,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With