This is a library to zip and unzip files and folders.
Functions:
ABZipDirectory(sourceDir, zipFile)
zip a folder with all its files and subdirectories
Example:
ABZipfile(sourcePath, sourceFile, zipFile)
Zip a single file
sourcePath must end with "/"
Example:
ABUnzip(zipFile, targetPath)
Unzip a zip file
Example:
ABListZip(zipFile)
List the contents of a zip file
Example:
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()
Functions:
ABZipDirectory(sourceDir, zipFile)
zip a folder with all its files and subdirectories
Example:
B4X:
myzip.ABZipDirectory(sdRoot & "start", sdRoot & "myZip.zip")
ABZipfile(sourcePath, sourceFile, zipFile)
Zip a single file
sourcePath must end with "/"
Example:
B4X:
myzip.ABZipFile(sdRoot & "start/" , "test4.txt", sdRoot & "myZipOneFile.zip")
ABUnzip(zipFile, targetPath)
Unzip a zip file
Example:
B4X:
myZip.ABUnzip(sdRoot & "myZip.zip", sdRoot & "target")
ABListZip(zipFile)
List the contents of a zip file
Example:
B4X:
Dim myZipFile as ABZipContent
listview1.Clear
counter = myzip.ABListZip(sdRoot & "myZipOneFile.zip")
For a = 0 To counter - 1
myZipFile = myZip.ABGetListItem(a)
listview1.AddTwoLines(myZipfile.Name, "Size: " & MyZipfile.Size & " bytes Compressed Size: " & myzipFile.CompressedSize & " bytes")
Next
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()