Carbide.c++ Tutorial 1 - Helloworld
This tutorial provides a basic Symbian C++ "hello world" example. It demonstrates 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 #Source Code.
Carbide.c++ is Nokia's IDE for developing application on various platforms, like Symbian C++, Open C/C++, Qt, 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++.
Step 1 - Create new project
- Start with a new Symbian C++ project using file menu of carbide c++.
- Next select GUI application with UI designer as an option on next screen as shown in screenshot.
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.
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.
Step 4 - Application properties
In the next step, you will be prompted to enter few application properties.
Step 5 - Select the view type
In the next step, the wizard prompts to select a view type for the application.
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.
Step 7 - Some more properties
In the next step, we will need to input some more information like UID .
Step 8 - Select / change project directories.
- Accept default suggestion for directories in the next step. Finish the wizard by clicking the finish button.
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.
Step 10 - Building the application
Now following these steps, you can run your first Helloworld application.
- Go to Project Explorer window right click your own project name.
- From the popup menu select the Build Project option.
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.
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.
The output can be observed in the emulator.
Now we have the basic Symbian C++ helloworld application running, doing nothing great.
- Further, click on options menu in the bottom window. It will bring up the menu in the main application window.
- Next, in the menu type down the name as shown in figure.
- Next, right click on the menu option itself and a pop will appear.
- From this pop up select the option called "Handle Selected Event".
- In the event handler function/method type down the code from the screenshot.
- Now, save the file and run the application the way described above.
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.