Compress Your Symbian C++ Executables

in

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 applicationUncompressed sizeCompressed size
HelloWorldBasic5,868 bytes 2,414 bytes
SoundMixer (available at Forum Nokia Web site) 12,604 bytes5,635 bytes
Example3D (available at Forum Nokia Web site) 30,476 bytes 13,577 bytes
Example applicationStart time (uncompressed)Start time (compressed)
HelloWorldBasic1.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....

> Compress Your Symbian C++ Executables

Or use ecompxl ( http://www.yipton.demon.co.uk/ecompxl/latest/readme.html )

ecompxl can also be made to work in symbian 6.1(you need one or two headers from a 7.0 sdk though to recompile it for 6.1), plus has the added benefit of allowing global objects/data in .app (useful when for example porting some stuff and you want .app rather than .exe).

> Compress Your Symbian C++ Executables

But ECompXL will not work with DLL's...

> Compress Your Symbian C++ Executables

Is there an open source for file compression for series 60 NOKIA mobile phone because were trying to make one for our school project.. pLease help...

contact me here: blue_kaijin@yahoo.com

> Compress Your Symbian C++ Executables

By scanning the Perl files in the SDK, I found out that this is implemented by passing the option "-compress" to PETran if the keyword COMPRESSTARGET is present in the MMP File.

The version of PETran released by Symbian as open source does not support this so has anyone figured out (i.e. reverse-engineered) what exactly is done when PETran is executed with the "-compress" option?

> Compress Your Symbian C++ Executables

Is there a compilation option for the UIQ2.0 and 2.1 platform ? It seems that the COMPRESSTARGET one is unknown on those OS

Compress Your Symbian C++ Executables

Nice feature... works very well. Does anybody know if it is possible to uncompress a .app file once it has been compressed. By that.... I mean can I run a utility on my PC that will take a symbian .app file and produce and uncompressed version of the .app file?

Re: Compress Your Symbian C++ Executables

petran -nocompress <file> works for me in Symbian 9.1.

Happy hex editing!