Zip/Unzip Library


Licensed User
This is a library to zip and unzip files and folders.


ABZipDirectory(sourceDir, zipFile)

zip a folder with all its files and subdirectories


myzip.ABZipDirectory(sdRoot & "start", sdRoot & "")
ABZipfile(sourcePath, sourceFile, zipFile)

Zip a single file
sourcePath must end with "/"


myzip.ABZipFile(sdRoot & "start/" , "test4.txt", sdRoot & "")
ABUnzip(zipFile, targetPath)

Unzip a zip file


myZip.ABUnzip(sdRoot & "", sdRoot & "target")

List the contents of a zip file


Dim myZipFile as ABZipContent 

counter = myzip.ABListZip(sdRoot & "")
For a = 0 To counter - 1
   myZipFile = myZip.ABGetListItem(a)
   listview1.AddTwoLines(myZipfile.Name, "Size: " & MyZipfile.Size & " bytes   Compressed Size: " & myzipFile.CompressedSize & " bytes")
ABGetListItem(int index)

Get one if the items in the zipfile to get more information. Fill this list first by calling ABListZip()

Example: see ABListZip()



Well-Known Member
Licensed User
Is it possible to add support for zip files that are in the assets directory?

I have a lot of files in the assets directory that need to be on the SD card for updating. I zipped them up and added the zip to the assets, but I cannot unzip it directly. As a work-round I copy it to the zip to the internal cache and unzip from there.


Well-Known Member
Licensed User
Thanks Erel, I know I can do that but using a zip file simplifies the coding. The reasons for using a zip file are:

1) Unzipping it recreates the directory structure
2) I do not need a load of "File.Copy" commands
3) I can add files to the zip later on without altering the code

Copying to the internal cache before unzipping is not a problem at all, but I was wondering if it is possible to do an unzip directly from the assets.

Edit to add:

While I remember, the code in the first post confused me slightly:
myZip.ABUnzip(sdRoot & "", sdRoot & "target")
I did not at first appreciate that sdRoot had already had the trailing "/" added to it so I was trying to use
myZip.ABUnzip(File.DirAssets & "", File.DirInternal & "target")
Instead of
myZip.ABUnzip(File.DirAssets & "/", File.DirInternal & "/target")
Last edited:


Active Member
Licensed User
extract just 1 file from the zip

will it be possible to extract just 1 file from the zip?


Well-Known Member
Licensed User
Unzip only a few files from a zip-file

Im very interessted in the last question from Cor. I have tried something, but it doesn't work. Is there a way to unzip only one or a few files out of the whole zip-File? It will be useful by working with many tiles of maps....

Thanks for an answer....


Active Member
Licensed User

I have sent you a PM via the forum. Did you get this? Please read. It would be nice if you could help me!



Licensed User
what about in memory compression? For example, compressing/decompressing a string value instead of a file? Developed my own ebook format using json and compressed sections instead of a container zip. Would love to be able to port it to Android.


Active Member
Licensed User
ABUnzip is stripping Characters in Filenames

I have downloaded a zipfile, that contains a folder with 3 files.

Name of the zipfile "olé.zip"
Name of the zipped folder: "/olé"
Name of the files in "/olé":

"olé 090.mp3"
"olé 100.mp3"
"olé 110.mp3"

Downloading the zip-file and unzipping it with ABUnzip to the Destination Folder works fine, the unzipped folder has the correct name, but the three files in the folder are renamed to

"ol 090.mp3"
"ol 100.mp3"
"ol 110.mp3"

Is this a Bug in the ABUnzip Function or did i do something wrong, when i uploaded the zipfile with Filezilla.