## N-Gage Projects

Carbide.c++ supports the importing of N-Gage projects. However, there are some process issues that effect how you can debug game projects on devices. The following provides a high level overview of the process you should follow to successfully import, build, deploy, and debug an N-Gage game on a device.

#### Importing N-Gage projects

To start, import your game project into Carbide:

1. Install the N-Gage SDK on your PC
2. Place your game project inside the N-Gage SDK
3. In Carbide.c++, click File > Import
4. Select Symbian OS Bld.inf importer and navigate to your bld.inf file to import it

#### Building the N-Gage project

Once the game project has been imported, use these steps to create an N-GAGE game file:

1. Right-click the project and choose Properties to open the Properties for project_name window
2. In the Carbide.c++ > Carbide Build Configuration > SIS Builder panel, click Add.
3. In the SIS Properties window:
   1. Specify the project and metadata PKG files to build
   2. Enable the Sign sis file with certificate/key pair for each PKG file
   3. Select the certificate/key given to you by the Nokia R&D Certificate Service
   4. Click OK
4. If using a batch file to build the N-Gage installation, create a new builder within Carbide by opening the Properties for project_name > Builders panel and click New.

Figure 1 - Builders pane in project Properties dialog

5. Open the Properties for project_name > Builders panel
6. Click New
7. Select Program in the Choose configuration type window, click OK

Figure 2 - Properties for N-Gage Builder dialog

8. In the Properties for New_Builder window Main tab:
   - Define the builder name in the Name text box
   - Specify the Location of the builder of the installation file
   - Specify the Working Directory
9. Click OK

The new builder appears in the Builders panel. The build steps are performed in the order they are displayed. Your builder name should appear under the Carbide CPP Project Builder item. If not, use the Up or Down controls to set the build order.

Figure 4 - Builder dialog with new N-Gage Builder defined

10. Click OK to close the Properties for project_name window
11. Build the project and its SISX file by selecting the Project > Build Project menu item

The Console view shows information as the project and it's SISX file are built and then the build of the installation file (N-GAGE).

### For On-device Debugging

#### Deploying the N-Gage project to a device

Once you have an .N-GAGE game file, you need to deploy it on the target device:

1. Verify that you have a valid developer certificate on the target device given to you by the Nokia R&D Certificate Service. If not, get and install one.
2. Verify that you have Application TRK installed on the target device. If not, install it now using On-Device Connections > New Connection Wizard > Install remote agents pane.
3. Manually install the .N-GAGE file on the device

#### Debugging the Game project

With your game file installed on the device, create a launch configuration for the project. In Carbide:

1. OpenWindow > Preferences > Run/Debug > Launching preference panel and disable the Build (if required) before launching option
2. Right-click the project and choose Debug As > Open Debug Dialog to open the Debug window
3. Create an Application TRK launch configuration
   - In the Connection tab select the COM port used to connect to the device.
   - In the Installation tab, verify that the game SISX file is correct
   - In the Debug tab, enable the View messges between PC and debug agent on the phone if you want to monitor communications between TRK and Carbide
4. Click Debug

The Debugger launches the game project in the device and halts when it encounters the breakpoint you set.

### For Emulator Debugging

#### Deploying and debugging the N-Gage project on an emulator

With your game file installed to the emulator, create a launch configuration for the project. In Carbide:

1. Open Window > Preferences > Run/Debug > Launching and disable the Build (if required) before launching option
2. Right-click the project and choose Debug As > Open Debug Dialog to open the Debug window
3. Create an Symbian OS Emulation launch configuration
4. Click Debug to launch the emulator
5. In the emulator, select File > Open, locate and select the .N-GAGE installation file and click Open to install the project
6. Open the Installation folder, launch the N-Gage runtime application
7. In the N-Gage runtime launch the game
8. If any breakpoint is hit in the game project, the debugger suspends

From this point you can use all of the debugger features to debug the project.

Always refer to the N-Gage documentation for more information on creating, deploying, and debugging N-Gage projects.