MonoDroid appears to be missing the Android.Uitl.Zip namespace.
Is there a way with Mono for Android to unzip an asset to the documents folder?
Here’s how in Java:
http://www.jondev.net/articles/Unzipping_Files_with_Android_(Programmatically)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I was trying to do the same thing and had to resort to a third-party library. Others have suggested SharpZipLib, but the license might be a problem if you’re not working on an open-source project. DotNetZip is also open-source but it has a more permissive license, and I was able to use the source code in Mono for Android without too many headaches. I’ve only used it to extract zips so far, so you may have to do some debugging if you want to use any of the other functionality.
Here’s the procedure I used:
Grab the source code from http://dotnetzip.codeplex.com/SourceControl/list/changesets.
Copy the Zip, Zlib and CommonSrc directories into your Android Mono project. Only copy the .cs files and don’t copy any of the subdirectories.
Delete the ZipFile.SaveSelfExtractor.cs file from the Zip directory.
Comment out this line from the ValidateOutput function in ZipEntry.Extract.cs.
Once I did all that, extracting was pretty simple: