Is it possible if I want to create my application that need to zip the video and user must have password authentication to open file ?
If it poosible , could you guys provide me some of example code ? Than开发者_开发技巧ks , Regards
Try something like this:
OutputStream out = new ZipOutputStream(new CipherOutputStream(new FileOutputStream(...)), cipher);
And the other way around:
InputStream in = new ZipInputStream(new CipherInputStream(new FileInputStream(...)), cipher);
For creating the cipher, see: http://developer.android.com/reference/javax/crypto/Cipher.html
I'm not sure what you exactly need, But if you want to have password protected zip files you can use this library: Here are some code snippets taken from there:
Zip:
ZipArchive zipArchive = new ZipArchive();
zipArchive.zip(targetPath,destinationPath,password);
Unzip:
ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip(targetPath,destinationPath,password);
精彩评论