Getting Started with Symbian Devices

This page covers my experiences starting programming for the the Sony Ericsson P800. I hope it will provide some useful advice and help you avoid some gotchas developing for this platform.

I have only just started programming on the Symbian platform, so I would be very happy to hear any suggestions or corrections. If you have any comments please email me at symbian+Steven.Murdoch@cl.cam.ac.uk.

Installing the P800 SDK

The SDK for the P800/P802 supporting UIQ on Symbian OS v7.0 was fairly simple to install. Since I am not using Codewarrior and just the supplied GCC based tools I did not install any development tool first.

The main part of the SDK is in a Zip archive, split into 6 parts. The first part (which is actually the last in the spanned zip file) is called uiq_sdk_r2.zip, and the remaining 5 parts are named uiq_sdk_r2.z01uiq_sdk_r2.z04. I then opened up part 1 — uiq_sdk_r2.zip and unzipped the archive to a temporary folder. Winzip handled the spanned archive automatically. I also downloaded the "Missing file from the UIQ SDK" and unzipped the com[1].symbian.q-arm... file into the temporary folder, but I am not sure if this is necessary.

I then started the setup.exe and followed the defaults, except for setting the location of the SDK installation to D:\Symbian. Finally I downloaded the uiqsdk_update_rc1.zip file, unzipped it to a different temporary folder and installed it via the setup.exe application. The symbian_p800_emulator.zip file is simply an BMP image of the P800 with configuration settings for the emulator. If you don't have the emulator provided with CodeWarrior then this file is of no use.

Compiling a simple UIQ application for the P800 using GCC on Windows

The SDK for the P800 from Sony Ericsson recommends CodeWarrior Development Studio for Symbian OS, however this is expensive ($400 – $1,400). A cheaper option is to use the command-line development tools included in the SDK, based around GCC. This means you cannot use the Codewarrior IDE, but more significantly you cannot use the emulator/debugger nor use the on-phone debugging.

The UIQ SDK is built for Windows NT4/2000/XP and while it is possible to develop for the P800 on Linux, I have gone for the easier option initially and used the supplied Windows tools.

As an example I will go through how I compiled UIQ_70/UIQExamples/BasicApp. I have more or less followed the >> UIQ SDK >> C++ >> Getting Started >> HelloWorld example but have deviated where the instructions did not work.

Environment variables

To use the development tools I had to add the following to %PATH%:

Do not add D:\Symbian\UIQ_70\epoc32\tools, these are called by the stubs, but the stubs set up environment variables needed by the tools. Perl was already installed on this machine before the UIQ SDK so the SDK installer did not install it. However it did not have all the libraries necessary so I had to add these manually by setting %PERL5LIB% to D:\Symbian\UIQ_70\epoc32\tools\perllib.

Add the device

To register the device with the environment I ran the devices command: devices -add D:\Symbian\UIQ_70 D:\Symbian\UIQ_70 @UIQ_70:com.symbian.UIQ. The first parameter is where epoc32 is, the second is where tools is. You only need to do this once, the device details are saved in the environments configuration file.

Building

In BasicApp there is already a bld.inf file, but in some I have seen this has been missing. If you need to create it then all it needs to contain is the name of the .mmp file. For example:

PRJ_MMPFILES
BasicApp.mmp

To produce the build scripts run bldmake bldfiles @UIQ_70:com.symbian.UIQ

To build the program run abld build thumb urel @UIQ_70:com.symbian.UIQ

The thumb parameter specifies the build target architecture. The .pkg file for this application specifies it is a thumb application, but the P800 also supports the armi target. Using thumb code produces applications that are smaller, but run slower.

Packaging and uploading

In order to send the application to the phone I had to make an SIS file which could then be opened by the software installation tool on the PC connected to the phone.

The configuration file for making a SIS file is a .pkg file. For BasicApp the .pkg file is supplied as BasicApp_thumb.pkg, but they are easy to write. The important lines are:
#{"BasicApp"},(0x101F6164),7,0,0,TYPE=SA
which identifies the application and
(0x101F617B), 2, 0, 0, {"UIQ20ProductID"}
which states that it is compatible with UIQ v2.0. Alternatively the line:
(0x101F80BE), 1, 0, 0, {"SonyEricssonP80xPlatformProductID"}
states that it is only compatible with the P80x.

The lines:
"\Symbian\UIQ_70\epoc32\release\thumb\urel\BasicApp.app"-"!:\system\apps\basicapp\basicapp.app"
"\Symbian\UIQ_70\epoc32\data\z\system\apps\BasicApp\BasicApp.rsc"-"!:\system\apps\basicapp\basicapp.rsc"
specify the source and destination for the files to be sent to the device. For the .app file, note that it is in the release\thumb\urel folder. If the build target was armi then in the source filename, thumb should be replaced by armi.

The condition IF CPUABI=2 specifies that the files should be installed if and only if the CPU supports the Thumb instruction set, otherwise it should not exit, but silently install no files (since the error message is commented out). If the error message is uncommented then it still will install no files, but the line "nosupport.txt"-"", FILETEXT, TEXTCONTINUE will cause the contents of nosupport.txt to be displayed in a dialog box during the installation process, with a "Continue" button.

To make the SIS file run makesis BasicApp_thumb.pkg @UIQ_70:com.symbian.UIQ. The SIS file can then be installed simply by double clicking on it and following the instructions.


Steven J. Murdoch

Valid XHTML 1.0! Valid CSS!