My app zips several files, saves the zip file to the SD card, and it emails the zip file to an address.
The zipping is done with this code: Zipping Files with Androi
I've searched a lot and finally found a good library that can zip files with password easily:
Zip:
ZipArchive zipArchive = new ZipArchive();
zipArchive.zip(targetPath,destinationPath,password);
Unzip:
ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip(targetPath,destinationPath,password);
Rar:
RarArchive rarArchive = new RarArchive();
rarArchive.extractArchive(file archive, file destination);
The documentation of this library is good enough, I just added a few examples from there. It's totally free and wrote specially for android.