You Are Here:

Community: Wiki

This page was last modified on 23 September 2009, at 15:14.

Carbide.c++ Tutorial 1 - Helloworld

From Forum Nokia Wiki

Reviewer Approved   

Contents

Introduction

Carbide.c++ is Nokia's IDE for developing application on various platforms, like Symbian C++, Open C/C++, Qt for S60, etc. Symbian C++ development has really become easy (to good extent) after the invent of the IDEs. Carbide.c++ comes with a unique tool called as UI designer, allowing faster prototyping and deployment. This tutorial mainly deals with UI designer and it can be followed on all editions of Carbide.C++.

The Example

The tutorial is basically a hello world example. It will be demonstrated all the steps necessary to develop a helloword GUI based Symbian C++ application and how to use UI designer. The example code is also available here.

This tutorial assumes that S60 SDK and Carbide.c++ is already installed and setup. Check here for more information.

The step by step guide

Step 1 - Create new project

1) Start with a new Symbian C++ project using file menu of carbide c++. 
2) Next select GUI application with UI designer as an option on next screen as shown in screenshot. 

This step enables the GUI editor for the project.

Image:Hello_step1.JPG

Step 2 - Enable UI designer

Next enter the desired name of project. As a basic user, select the default location.

Once you get some expertise you can select any other workspace. Basically carbide.c++ manages the projects using workspaces. Workspace is a collection of projects. One can group relevant projects in one workspace. In carbide it is possible to switch between multiple workspaces. One can set the default location and can explore more there.

Image:Hello_step2.JPG

Step 3 - Select the build configuration

In the next step, the wizard asks to select the build configurations to be added for the project. Usually, by default, all the configurations are selected.

For this project and for most of the projects, Emulator debug (WINSCW) and one Phone release configuration is required. 

Once this is confirmed click on next.

Image:Hello_step3.JPG

Step 4 - Application properties

In the next step, you will be prompted to enter few application properties.

Enter the application name here as Helloworld. You can keep rest of the things as default.

Image:Hello_step4.JPG

Step 5 - Select the view type

In the next step, the wizard prompts to select a view type for the application.

For our application select an empty container as we will not have any control in it.

Image:Hello_step5.JPG

Step 6 - Select name for the view

The next step involves naming the container class and the type of the class, as shown in figure. 

One more important thing that is selected in this step is the support for view switching ability.

Image:Hello_step6.JPG

Step 7 - Some more properties

In the next step, we will need to input some more information like UID .

If you are not aware of these concepts you can leave the defaults and go to next step.

Image:Hello_step7.JPG

Step 8 - Select / change project directories.

Accept default suggestion for directories in the next step. Finish the wizard by clicking the finish button.

Image:Hello_step8.JPG

Step 9 - Changing title of application window

Now we will have the UI designer window which showcases the application window in it.

Double click the title of the application window and change it to Helloworld or anything else that you wish.

Image:Hello_step9.JPG

Step 10 - Building the application

Now following these steps, you can run your first Helloworld application.

1) Go to Project Explorer window right click your own project name.  
2) From the popup menu select the Build Project option. 

If everything goes well you will have no errors in bottom output window.

Image:Hello_step10.JPG

Step 11 - Running the application

Once the build is successful, run the application with the help of pop up menu. 
To get the popup, right click on the project as show in the figure. 

One this is done, Carbide launches the emulator and the application is started in the emulator.

Image:Hello_step11.JPG

Step 12 - Emulator output

The application usually starts in the emulator (S60 3rd FP2 onwards), once run option is selected. If not then it can be started manually from installation menu in the emulator. When you start to run the application it asks for the process to run make sure that it is name of the process is the one which we want to run.

Image:Hello_step12.JPG

The output can be observed in the emulator.

Image:Hello_step13.JPG

Step 13 - Add a menu option

Now we have the basic Symbian C++ helloworld application running, doing nothing great.

1) Further, click on options menu in the bottom window. It will bring up the menu in the main application window.

Image:Hello_step14.JPG

2) Next, in the menu type down the name as shown in figure. 

This will add a new menu option to the "Option" menu.

Image:Hello_step15.JPG

3) Next, right click on the menu option itself and a pop will appear. 
4) From this pop up select the option called "Handle Selected Event". 

Image:Hello_step16.JPG

This should bring up the code window, where you can edit the code for the event. This is basically a method which will get called when the menu will be selected.

Image:Hello_step17.JPG

5) In the event handler function/method type down the code from the screenshot.

Image:Hello_step18.JPG

6) Now, save the file and run the application the way described above. 

This should give the output as below.

Image:Hello_step19.JPG

Conclusion

This way, a basic helloworld application can be developed using Carbide c++. Few steps are unnecessary in the wizard but sometimes they turn to be useful. Following the same steps one can develop his own application. This tutorial can be followed by any person with minimal knowledge of Symbian. But for further things a good tutorial on Symbian C++ is necessary.

Source Code

File:Carbid tut1 Helloworld.zip

Back to the tutorial

Here you can visit the main page of tutorial

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia