Android Programming Press on the image to return to the main documentation page.

ABZipUnzip

Written by Alain Bailleul

List of types:

ABZipContent
ABZipUnzip

ABZipContent

An object that the contains information about an entry in the zip file

Events:

None

Members:


  CompressedSize As Long  [read only]

  Name As String  [read only]

  Size As Long  [read only]

Members description:

CompressedSize As Long  [read only]
Returns the compressed size of the entry
Name As String  [read only]
Returns the full path and name of the entry
Size As Long  [read only]
Returns the uncompressed size of the entry

ABZipUnzip

Object that does zip en unzip files on the device

Permissions:

android.permission.WRITE_EXTERNAL_STORAGE

Events:

None

Members:


  ABGetListItem (index As IntAs ABZipContent

  ABListZip (zipFile As StringAs Int

  ABUnzip (zipFile As String, targetPath As StringAs Boolean

  ABZipDirectory (sourceDir As String, zipFile As StringAs Boolean

  ABZipfile (sourcePath As String, sourceFile As String, zipFile As StringAs Boolean

Members description:

ABGetListItem (index As IntAs ABZipContent
Get one if the items in the zipfile to get more information. Fill this list first by calling ABListZip()
ABListZip (zipFile As StringAs Int
List the contents of a zip file

Example:
  
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
  
ABUnzip (zipFile As String, targetPath As StringAs Boolean
Unzip a zip file

Example:
  myZip.ABUnzip(sdRoot & 
"myZip.zip", sdRoot & "target")
  
ABZipDirectory (sourceDir As String, zipFile As StringAs Boolean
zip a folder with all its files and subdirectories

Example:
  myzip.ABZipDirectory(sdRoot & 
"start", sdRoot & "myZip.zip")
  
ABZipfile (sourcePath As String, sourceFile As String, zipFile As StringAs Boolean
Zip a single file

sourcePath must end with "/"

Example:
  myzip.ABZipFile(sdRoot & 
"start/" , "test4.txt", sdRoot & "myZipOneFile.zip")
  

Top