Zip file compression and decompression
One of the main considerations when running applications on mobile devices is the size of your data. In some cases you may have a mobile sales application that must contain all the latest product details and prices. If your user is working remotely, you don’t want to spend lots of time and money downloading such data. The solution is to compress the data to minimise the transfer time required.
Additional to this, you also have to consider that the devices do have a limited amount of storage space. If you only require a small subset of that data at any one time, why not compress the rest to keep memory available for the operating system.
Sapphire Solutions (http://www.sapphire-solutions.co.uk) have developed the GZip Utility that allows you to compress and decompress files in the .gz and .zip format. Your application can download a zip file from your server and decompress the data on the device ready for use. Similarly, the data that is to return to the server can be compressed.
The Sapphire GZip Utility is a small DLL that allows your eVB or VB.NET utility to call the functions to compress or decompress files. You can either compress or decompress a single file into the .gz file format. Alternatively, you can compress or decompress a series of files using the .zip files format. These files are compatible with Windows based programs such as WinZip.
The Sapphire GZip Utility provides the following functionality:
Running the demo project
Sapphire have also provided an extensive demo project in both eMbedded Visual Basic and VB.NET that show how to use all the functions of the DLL. You get all the eVB and VB.NET source code which is not only great for experienced programmers to implement the utility, but also great for new programmers to see how the application has been approached.
The latest version of the Sapphire GZip Utility can be downloaded from their web site here:
Once you have downloaded the demo project and unzip it, you will have two versions of the demo project, one for eVB and the other for VB.NET. You will also have a folder containing the different DLLs compiled for the different devices.
Simply select the DLL that matches the device. If you are developing in eVB, then you will need to copy the DLL to the \Windows\ path. Alternatively, if you are developing in VB.NET or C#, you need to copy the DLL to the application path. Check the project settings to see where the demo project will deploy itself to.
Now you are ready to run the demo. Please note the following screenshots have been taken from the VB.NET demo project.
Compressing files to the zip format
Decompressing a zip file
Zipping a file
Dim lError As Integer
lError = sZip(txtFile.Text, txtZip.Text, chkSubs.Checked, 1234567890)
If lError <> 0 Then
Unzipping a file
Dim lError As Integer
lError = sUnzip(txtZip.Text, txtFile.Text, chkSubs.Checked, 1234567890)
If lError <> 0 Then
Sapphire Solutions also provide a comprehensive manual for all their utilities. It includes a definition of the DLL function calls, some sample code and FAQs to help with any troubleshooting.
Their manual documentation can be viewed online, downloaded as a HTML document for offline use and even a downloadable Windows help file. These can all be found on their web site at http://www.sapphire-solutions.co.uk/manual.
Licence of use
Sapphire Solutions provide an unlimited use demo version of the Sapphire GZip Utility. While the product will function as normal, the user will receive a popup message stating that it is a demo version. It is great for trying out the utility, checking device compatibility, building it into your application and selling the idea to your customer. Students can use it as well for their college or university projects without having to purchase it either.
Of course though, for commercial applications being developed you will need to get a licence for the utility to make it run without any pop-ups. The good thing about Sapphire’s pricing policy is that it is a one off fee and you or your company can use it as many times as you like for your projects royalty free. There are no royalties required for rolling out your application to your client.
With that you will also get 12 months support via email to their experienced technical team. They also provide upgrades for the latest versions at discounted prices which also extend the 12 months support by a further 12 months.
|Copyright © 2004, CFVB.NET. All Right Reserved.|