|
Nokia N97 SDK Example Applications Guide |
1. About this Example
2. Prerequisites
3. Design and Implementation
Any kind of file (txt, doc, xls, xml, mpeg, ppt, mp3 etc) can be compressed .
When we launch it through icon it prompts to enter the mode to process.
Here we have to choose the strategy to compress. The strategy parameter is used to select the compression algorithm.
When asked to compress, it reads the file and then compresses it using libz api's and then stores the compressed content in a compressed (.gz) file.
If you want to decompress, type d.
When asked to decompress, it opens the compressed (.gz) file using libz api's and then reads the content and decompresses it.
If you want to check what happens to the content of the string after compression then type s. Here you can enter the string you want and see the data in compressed format .
This option is kept to demonstrate compression of string using libz api's.
To Run This application through eshell :
Usage : OpenCLibz [-d] [-f] [-h] [-r] [-1 to -9] [files...] -d : decompress -f : compress with Z_FILTERED -h : compress with Huffman encoding -r : compress with run-length encoding -1 to -9 : compression level files : absolute path of files
(drive letter):\[(folder name)\]filename.
For example Using Unix's gzip files can be compressed and compressed files have .gz extension. Using this application you can decompress the files created by gzip. Otherwise we can compress the files using my example application and decompress it using Unix's gunzip.
Compression can be done in a single step, if the buffers are large enough; or compression can be done by repeated calls of the compression function. In the second scenario, application must provide more input and consume the output (providing more output space) before each call.
All the components are written in pure C-code.
The application has its own icon and can be launched from the UI both in the emulator and in the device.
fopen, fclose, fread, fwrite, mmap, munmap, fstat, unlink, printf, scanf from libc library
|
© Nokia 2009 |