Starting Development for the Series 60 Platform
Starting Development for the Series 60 Platform
By: D'Arcy Salzmann
Jul. 28, 2003 11:19 AM
This article will show you how to develop your very first Series 60 application using CodeWarrior, and get it running on a mobile phone.
When many developers think of wireless development, they think of CodeWarrior. For J2ME and Palm developers, CodeWarrior has long been the standard for application development for mobile devices. Metrowerks has a long history of supporting developers of embedded systems with powerful tools for cross-platform compilation (developing on one device and running on another). Whether you were developing for a Palm OS, Java phone, or embedded device like a DVD player, CodeWarrior was the tool of choice.
Now that we're all carrying embedded devices in our pockets, devices that can be programmed by independent developers like you and me, Metrowerks has expanded its tool offerings to include devices based on Symbian OS and the Nokia Series 60 user interface. For experienced developers, this offers a familiar environment, while developers new to Symbian OS get the most powerful development tools available for the platform. While there are other tools available for Series 60 development, I'll take my hat off to anyone who's using them every day.
This article will show you how to develop your very first Series 60 application using CodeWarrior, and get it running on a mobile phone. Before you start, you'll need a copy of CodeWarrior Developer Tools for Symbian OS, Personal Edition, which ships with both the Series 60 and UIQ phone SDKs. In addition, a Series 60 device (such as a Nokia 7650 or Nokia 3650) is required if you want to run your code on a phone, but you can create full working applications using only the SDK. A copy of Nokia PC Suite would also be useful.
CodeWarrior organizes your application code as projects, a collection of all the files necessary to complete your development. As a starting point, your project can be based on one of several provided stationery templates, which contain predefined configuration information and files relevant to your development. The Series 60 SDK is delivered with three pieces of stationery: HelloWorldplus - a Series 60 example project; NewProject - a source with empty modules for a good starting framework; and Untitled - a bare project that has empty sources and minimal libraries necessary to start a project. Depending on how you want to configure your initial project, one of the stationeries should meet your needs. Once you become more experienced in Symbian OS development, you can create your own stationeries.
We will illustrate the CodeWarrior development process using the HelloWorldplus stationery. To start a new project, select "File|New" from the menu and from the Project tab of the "New" dialog choose Symbian Stationery Wizard (see Figure 1). Enter a project name and specify the location where you want to store the project.
Clicking OK displays the CodeWarrior Symbian Stationery Wizard - SDK Selection dialog. Select Nokia from the Vendor list and "Series60_CW" from the SDK list (see Figure 2).
Clicking Next takes you to the Stationery Selection dialog; expand the C++ folder and you will see the stationeries we described above. Select HelloWorldPlus and click Finish to create your project (see Figure 3).
Your project is now opened in the Project Window. The "Files" tab should be selected by default and you'll see that there are two folders in there - Source and Libraries. Expanding the Source folder reveals the source files for your project included from the Stationery. The Project Window has two other tabs: "Link Order", which provides information on the link order to be used when compiling the code; and "Targets", which contains details about the targets that the code will be compiled for. We'll return to Targets shortly. Along the top of the Window are a number of icons for commonly used facilities and actions, including target settings, make, debug, and run (see Figure 4).
From the "Files" tab you can now open and edit your code. You'll see that there are several source code files that make up the HelloWorldPlus app. Select HELLOWORLDAPPUI, which handles the user interface. You're now in the powerful CodeWarrior Editor, where you build your code (see Figure 5). CodeWarrior will allow you to use your favorite editor if you wish, although that would mean you don't have access to features such as customizable keyword highlighting, the ability to pass breakpoints from the "Edit" view to a debug session, and the comprehensive file compare functionality.
In this case you have a ready-prepared application, so there's no need to edit the code. Closing the source code file you can now compile and run the application. Here there are several choices of targets: WINSCW, ARMI, and THUMB. WINSCW is the target for code you want to run in the Symbian emulator. This is selected by default for a new project, as this is where you would initially run your code while developing and debugging. The remaining targets are for builds that will run on Series 60 phones: we'll return to these later. Select the Targets tab and you'll see a list of targets for which builds can be created (see Figure 6).
WINSCW (the Series 60x86 emulator) targets are available as both UDEB or UREL (a Symbian convention to identify Unicode Debug and Unicode Release targets). The UDEB build includes symbolics necessary for debugging, while UREL is a release build without debug information. Because there is no on-device debugging functionality on Nokia Series 60 phones, you cannot make UDEB target builds for ARMI and Thumb (i.e., the Series 60 phone) targets, so only UREL is available. In most circumstances you'll build using UDEB initially and use UREL for code you want to test for performance, or to create a final candidate for the release of your application.
The next step is to compile and run your code in the emulator. The target, HELLOWORLDPLUS WINSCW UDEB, was set when the project was created, so all you need to do now is compile and run your application. You can do this simply by pressing F5. You will see the code compile and the emulator open. Select the "other" directory in the emulator and you'll see your HWPlus icon (see Figure 7). Select this and your application will be launched. If you have breakpoints set in your code that are triggered when the application is launched, the emulator will stop at the breakpoint and the debugger will be brought to the foreground.
Obviously this simple example does not need debugging. However, before we continue I'll mention some of the debug features, as you will probably spend some time using this feature during your development. Running Debug opens the debug window, which has three panes:
Each pane can be expanded to use the full debug window that allows you to easily review the debug information, particularly when dealing with large amounts of information, such as current variables.
Extensive debug actions are available to you, stepping line to line, stepping over or out of subroutines, and marking breakpoints. The Breakpoint control is comprehensive, with the ability to define them as temporary, only stopping the code execution once; conditional so that the code only stops if a variable contains a certain value; and rich breakpoints, where plug-ins can be activated. Other features include the ability to view symbolics and expressions, as well as edit variable values while debugging.
At this point we have created a project, created the code for our application, and run it in the emulator to check that it works. We are now close to having an application you can distribute to your customers.
To create a release application we first have to select the release target. Remember that the code we compiled last time was for the emulator. Now we go back into the Project Window and open the Targets tab. We have two choices here: ARMI and THUMB. THUMB is for memory-constrained ARM devices using 16-bit memory and bus to keep device costs down. ARMI is a target that can be run on either ARM4 (32 bit) or THUMB devices, and it is the one recommended for third-party Series 60 applications. So select the HELLOWORLDPLUS ARMI UREL target.
The next step is to set up the information so that CodeWarrior can create the Symbian OS installation file, known as a ".SIS" file. To do this we create a text file with the extension ".pkg." Under the CodeWarrior IDE "Edit" menu there will be an item HELLOWORLDPLUS ARMI UREL Settings? that opens the dialog for the target settings. In this dialog window, the "Target > Symbian Installation" choice displays the settings for constructing the SIS file. Here you name your SIS file. You can optionally add to the search path for source files (the Content Search Location setting) and the location for the resulting SIS file (the Output Location setting) (see Figure 8).
The key to making CodeWarrior generate the SIS file is to include a PKG file in the project. If you do this, CodeWarrior will invoke the Symbian tool from your device-vendor SDK (in this case, the Nokia Series 60 SDK), which creates the .sis file.
A simple SIS file for our application might look like this:
Compiling the application will create binaries for the phone and a SIS file package containing those binaries.
All that is now left to do is to install the application on your Series 60 phone. If you have Nokia PC Suite installed and your phone is connected to your PC, you can simply double click the SIS file, and the Nokia installer will open and install the application. Alternatively, you can send the SIS file to your phone via infrared, Bluetooth, or e-mail, where the phone installer will detect and install automatically.
This short tour has demonstrated how easy it can be to create a Series 60 C++ application using CodeWarrior. CodeWarrior has encapsulated the Series 60 and Symbian OS development process so that it's simple to undertake. This allows you, the novice or experienced Symbian developer, to concentrate on the things that matter: imagining, writing, and debugging great applications.
CodeWarrior Development Tool for Symbian OS Versions
CodeWarrior is available in three versions:
CodeWarrior Wireless Developer Kit for Symbian OS, which includes the Personal Edition, is available for the Sony Ericsson P800 and Nokia 3650. A kit including the Siemens SX1 will be available in September.
CodeWarrior for Symbian OS, Personal Edition, retails for $399.
To download a copy, please go to: www.metrowerks.com/MW/Develop/Wireless/ Symbian/Personal_Edition.htm.
For additional information, the following sites provide more details about CodeWarrior, Series 60, and Symbian OS development:
Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
SYS-CON Featured Whitepapers
Most Read This Week