On all devices based on Symbian OS v7.0s (Series 60 Developer Platform 2nd Edition, Series 80 Developer Platform 2.0, and Series 90 Developer Platform 2.0) it is possible to save considerable disk space by compressing an application’s executable files. Executable files include GUI application files (.APP), dynamic link library files (.DLL), and server files (.EXE). This step typically cuts the executable file size by 30 to 40 percent.
To use compression, simply add directive COMPRESSTARGET to the corresponding project definition file (.MMP) and recompile the project. The directive line can be anywhere within the project definition file.
The start-up time of the compressed application can vary from the uncompressed version, although the difference is typically not significant. The benefits of using compression generally outweigh possible disadvantages, therefore, it is strongly recommended to use compression.
Also, executable file compression does not significantly change the Symbian OS installation (.SIS) file size, since by default the installation file is also compressed.
Example usage: (HelloWorldBasic.mmp) COMPRESSTARGET
TARGET HelloWorldBasic.app
TARGETTYPE app
UID 0x100039CE 0x10005B91
TARGETPATH \system\apps\helloworldbasic
SOURCEPATH ..\src
SOURCE HelloWorldBasic.cpp
SOURCE HelloWorldBasicApplication.cpp
SOURCE HelloWorldBasicAppView.cpp
SOURCE HelloWorldBasicAppUi.cpp
SOURCE HelloWorldBasicDocument.cpp
SOURCEPATH ..\group
RESOURCE HelloWorldBasic.rss
USERINCLUDE ..\inc
SYSTEMINCLUDE \epoc32\include
LIBRARY euser.lib
LIBRARY apparc.lib
LIBRARY cone.lib
LIBRARY eikcore.lib
LIBRARY avkon.lib
Here are a few performance figures:
| Example application | Uncompressed size | Compressed size |
| HelloWorldBasic | 5,868 bytes | 2,414 bytes |
| SoundMixer (available at Forum Nokia Web site) | 12,604 bytes | 5,635 bytes |
| Example3D (available at Forum Nokia Web site) | 30,476 bytes | 13,577 bytes |
| Example application | Start time (uncompressed) | Start time (compressed) |
| HelloWorldBasic | 1.2 sec. | 1.3 sec. |
| SoundMixer | 1.8 sec. | 1.9 sec. |
| Example3D | 2.8 sec | 2.9 sec |
The application start-up times are measured using a Nokia 6600 device.
This tip was originally posted on Forum Nokia. Check the original version at http://www.forum.nokia.com/html_rea....
|