Mobiiliohjelmointi/Mobile programming

Exercise 1

 

Objective :

a)      Building  a new project

b)      Building an Imported project

 

Note: These exercises work with carbide.c++ ver 1.2.2. It is not guaranteed to work with earlier or later versions of carbide.

 

 

Part 1.

1. Create a Project

 

a)      Start carbide. Choose a workspace

b)      From the file menu, select File->New->Project

c)      A ‘New Project ‘ wizard should pop up. Select Symbian OS-> Symbian OS C++ Project. Then hit next

d)      The next pop-up will ask for a project type. Select S60 2nd Edition ->S60 2.x Hello world GUI application. Hit next.

e)      Enter a unique project name and hit next.

f)        Select the S60 SDK and hit next.

g)      Next you will see some fields with Basic Settings. These include the UID, copyright notice, your name and some text. Fill in as appropriate. Hit next.

h)      The final screen shows you the project directories. Do not make any changes for now. Hit Finish. Congrats! You have now created a Symbian project.

 

2. Build a Project

 

a) To Build your new project, find the C/C++ Projects window (normally top left). Select your project. You can build the project by

a) Right clicking the project and select Build Project.

b) Select from the menu bar Project->Build Project.

c) The key combination Ctrl-B will also build the project.         

b)         To run the project from the menu bar, select Run-Run As->Run Symbian OS Application.

c) This will start the emulator. It might take a few minutes for the emulator to start. Scroll down through the emulator until you find your project.

 

3. Debugging.

a) To insert breakpoints, right click on the extreme left of the line and select ‘toggle Breakpoint’.

b) To start the Debugger, select run->Debug As-> Symbian OS Application.

c) IN debugging mode, additional breakpoints can be inserted  by, go to a relevant line and selecting run->toggle Line Break. Alternatively, select the keyboard combination Ctrl-Shift-B, or right click on the extreme left of the line and select toggle Breakpoint. c) Now run the debugger again. Run ->restart.

 

4. Modify the project (add a new class)

            a) Select File->new->Symbian OS C++ Class

            b) Select your project and hit next.

            c) Select Simple Symbain Style C++ Class. Hit next.

            d) Give your class a name. Hit next. (This is a Heap based class, so remember to put a C before the name!).

            e) check out your new class. The *.cpp file should be found under the ‘src’ directory, and the header file under ‘inc’ directory.

 

Part 2 Importing and deploying a project.

1. Importing a Symbian project to Carbide.c++

  1. Copy qanda application , to a folder without spaces [D:\qanda].
  2. Start Carbide.c++
  3. Select File - Import
  4. Import Symbian OS project
    1. Select Symbian OS bld.inf
    2. Source - D:\qanda\group\bld.inf
    3. Select SDK s60_2nd_3fp
    4. Click Finish

2. Build and Run a project

  1. Select Project - Build all
  2. Copy afile.txt and qfile.txt to folder <Symbian workpath>\Epoc32\release\winscw\udeb\z\system\apps\qanda
  3. Select Run – Run As
  4. Wait... emulator will be started. Select icon Qanda.

 

3. Build a .sis file

a.       Select Project->Properties.

b.      From the list on the left hand side, select Carbide Build ConfigurationsUnder active configuration, select Phone release(ARMI) [S60_2nd_FP3]

c.       Check the directory <Symbian workpath>S60_2nd_FP3\Epoc32\release\armi\urel . You should find quanda.sis, quanda.lib and quanda. App. Quanda.sis can be downloaded to your phone using Bluetooth, or Pc Suite.

 

 

 

 

 

Installation of SDK & Carbide.

The software development environment used in this course is based on Carbide.c++ ver. 1.2.2 and the S60 SDK.

Before download, you will need to register with the Nokia forum web site first http://www.forum.nokia.com/  

Carbide can be downloaded here:

You must install a number other packages as well, instructions can be found in the link above. The exercises are based on the S60 SDK, which can be found here. For people who have phones that are not S60 based, you will need to download different SDK’s.

 

Please note.

Version 1.2 has a bug, it will not build the example given here. Please update to the latest versions of carbide. If you cannot do so, then you need to do the following.

            Open project->properties->carbide project settings

            In Build Target, select selected components.

            Build the project. You will get two errors. Click on the error messages and comment them out. Now build the file again.