C ++ SDK + Symbian Development

Source: Internet
Author: User
Tags codewarrior

 

C ++ SDK + Symbian getting started application developer online builder.com.cn updated on: 2007-12-28Author: Tao gang Source: Tianji net Keyword: C ++ SDK Symbian Application

Since the Series 60 application can be created from a command prompt or IDE, we also detail these two methods. First, we start by using the C ++ compiler provided by IDE to build a simulator (x86 Instruction Set) program running on a PC. We also use debugging settings, so we can use the symbolic debugging information and memory vulnerability check (dynamically check whether the allocated memory on the stack is correctly released ).

Create a program from the command line

Open the command prompt and change the current path to the drive/folder containing the Series 60 SDK. Navigate to a folder that contains the project definition (helloworld. MMP) and component description (BLD. inf) files-for example:

Symbianseries602_0emccsofthelloworldgroup

The above code is used for Series 60 2. x projects, or

Symbian.1series60emccsofthelloworldgroup

The above code is used for Series 60 1. x projects. And enter:

Bldmake bldfiles

The command is completed in a second or two, and there is no visual output. It uses the bld. inf and helloworld. MMP files to generate a new file, abld. bat. This command file is generally generated as needed. Unlike the bld. inf and. MMP files, abld. Bat cannot be migrated between different IDES and cannot be modified manually.

Enter the following command to compile and link the project:

Abld build wins udeb

-For visual C ++

Abld build winsb udeb

-Borland C ++

Abld build winscw udeb

-Codewarrior

The abld command will create this project (in other words, compile and link) for the Series 60 simulator (wins, winscw, or winsb) and include the debugging information in the binary executable file.

SlaveIDECreate a program

Project (for example, our exampleHelloworldApplications) are usually created and run in an IDE, so we need to use the bld. inf and helloworld. MMP file to create a project file for a specific IDE. For visual C ++, this work must be completed on the command line using the tool provided by Symbian. This is optional for borland and codewarrior because both ides can import bld. inf or. MMP files to create ide project files.

When we start working from the command prompt, if the abld. BAT file does not exist, it is necessary to establish it; if the. MMP file or the bld. inf file changes, it also needs to be re-created. Enter the following content in the command prompt to create the abld command file:

Bldmake bldfiles

Use MicrosoftVisual c ++Create a program

Open a command prompt and navigateHelloworldThe drive/project folder of the project, and enter:

Abld makefile vc6

This will create projects and workspace files (helloworld. DSP and. DSW files) suitable for Microsoft Visual C ++ ). They will be located in the epoc32build subfolders; their complete paths depend on the SDK location, for example:

Epoc32buildemccsofthelloworldhelloworldwins

By opening a workspace file (helloworld. DSW) in Visual C ++, You can compile or link the application by pressingF7Or use ide menu optionsBuild | build helloworld. app.

UseBorland C ++ ide Builder 6Create a program

If you use Borland C ++ Builder 6 mobile edition (based on Borland C ++ Builder 6 Personal Edition and added mobile plug-ins), you can simplyHelloworldThe bld. inf file of the Project is imported into IDE. UseFile | new | OtherMenu options, and then selectMobile(Mobile)Data PageImport Mobile Application(Import mobile applications). Browse the location of the component description file (BLD. inf) and open it.

UseCTRL + F9Or in the menuProject | makeCreate a program. To establish and runF9Or in the menuRun | run. Note:F9OrRun | runThis will cause the project to be re-created every time. If you only run on the simulator, useTools | mobile build tools | run emulator(Tools|Mobile creation tool|Running Simulator). IDE may prompt you to save a large number of project-related files, such as Borland Project (. BPR) and Borland Project Team (. BPG) files. These files are stored in the same location as the bld. inf file folder.

We can also execute independentAbldCommand and run other SDK tools (for exampleTools | mobile build toolsOn the menuAifbuilderAndSISAR).

UseBorland C ++ builderxCreate a program

When using any commercial C ++ builderx product, you can simplyHelloworldThe bld. inf file of the Project is imported into IDE.

UseFile | newAnd clickMobile C ++Data Page. SelectImport Symbian C ++ Project(ImportSymbian C ++Project). Select the correct Series 60 SDK from the drop-down list to view the location of the bld. inf file of the project. ClickNextData Page, give the project a name, and clickFinishData page, the project will open. PressCTRL + F9OrProject | make projectSelect. PressF9Or selectRun | run projectOr use a toolbarMake and runRun the project.

UseCodewarrior ideCreate a program

If you are using metrowerks codewarrior for Symbian (personal version 2.5, other versions may be slightly different), you can simply use the IDE menu optionsFile | import project from. MMP File(File|Slave. MMPFile Import Project)To import the helloworld. MMP file.

This will run the project conversion wizard. Select the SDK used by the project, select (or browse) The. MMP file, and select a winscw platform (or leave it empty ). The default value of build variable is udeb. UseF7Or in the menuProject | makeCreate a project.

The codewarrior project files (. CMP,. XML,. Resources, and. Pref files) are automatically created in the directory where the helloworld. MMP file is located.

You can also create a codewarrior ide project through the command line. Run the bldmake bldfiles described above, and then it generates a codewarrior ide project:

Abld makefile cw_ide

This will create a project file helloworld. XML that can be imported in the directory:

Epoc32buildemccsofthelloworldhelloworldwinscw

Now you can use codewarrior to import this file and generate a local project (. MCP) file. SelectFile | import Project (import Project)Menu option, select the helloworld. xml file, and select a name for the project (for exampleHelloworld). Codewarrior will generate and load the project. You can use normal ide commands to create, run, debug, and perform other operations.

 

 

C ++ SDK + Symbian getting started running developer online builder.com.cn updated on: 2007-12-28Author: Tao gang compilation Source: Tianji net Keyword: C ++ SDK Symbian run in Series 60 SDK two versions of the simulator executable file can be used: one version contains the symbol debugging information, the other is the release version. The release simulator is limited to evaluating or demonstrating only applications-it starts very quickly because it does not contain debugging information.

Both workers are called epoc.exe, but they are located in their own subdirectories. The name of the EPOC is legacy-it is the name of the operating system before the Symbian OS.

Debugging of simulators is often used in normal development activities. Depending on your ide, you can use the debugging version normally or in "debugging mode. The ability to run the same "debugging Simulator" in two modes seems a bit confusing at first.

Sometimes you may want to start the simulator, locate the application and run it, just for the purpose of testing. If a serious error occurs, the simulators and applications are closed in a constrained manner.

Sometimes you may want to set a breakpoint (breakpoint) Where you think there is a problem, and then let the IDE run the simulator in "debug mode. Then you locate the application and run it. When you interact with an application properly, a breakpoint in the code will be encountered. On the breakpoint, the source code is displayed in the IDE and all symbolic debugging information related to the application is displayed. Then, you can use the debugging feature of IDE to debug code snippets step by step under control. You can view the application source code, Data, call stack, and other debugging-related information displayed by IDE to help you track errors in code or logic.


Figure 1-3. Series 60 platform 1.2 debug the application table and List View of the simulator


Figure 1-4. helloworld application in debugging mode under Microsoft Visual C ++ ide

The executable file location of the simulator.

The Series 60 1.2 SDK release simulator is typically located below:

For visual C ++

Symbian.1series60epoc32releasewinsurelepoc.exe

For Borland C ++

Symbian.1series60epoc32releasewinsburelepoc.exe

For codewarrior

Symbian.1series60epoc32releasewinscwurelepoc.exe

The debugging simulator is typically located:

For visual C ++

Symbian.1series60epoc32releasewinsudebepoc.exe

For Borland C ++

Symbian.1series60epoc32releasewinsbudebepoc.exe

For codewarrior

Symbian.1series60epoc32releasewinscwudebepoc.exe

The exact path depends on the options you select when installing the SDK. In Series 60 2.x sdk, the simulator region will be very similar. For example, symbianseries602_0epoc32releasewinsudebepoc.exe.

Figure 1-3 shows the Series 60 1.2 simulator. It displays the table view or list view as the main menu of the application at startup.

The shape of the phone application launched by the Series 60 2.0 simulator is similar to that of the phone application. You must navigate to the Application menu by pressing the application button 1-3 shown. Regardless of the version of series connector used.

  Simulator debugging mode

When running an application in the debugging mode of the simulator, the source code, function call stack, and variable information are immediately displayed when a code breakpoint occurs, as shown in 1-4. If the application code is not at a location that requires user input, the simulator window may disappear (it is minimized ).

Run the simulator from a command prompt

If the supervisor runs the simulator from the command line, simply open a command to change the current supervisor to the Series 60 SDK folder (for example, symbian.1series60epoc32releasewinsudeb) where the epoc.exe application is located and enter the following content:

EPOC

The above command starts the debugging simulator, and then you can locate and run your own application, but it is not in debugging mode. The application to be debugged can only run in the IDE in the debugging mode of the simulator. To run the release simulator, enter:

EPOC-rel

  Run the simulator in Visual C ++ ide

In Visual C ++ IDE, you can press Ctrl + F5 or select build | execute epoc.exe from the menu to start the debugging version of the simulator. This will enable the simulator to be in non-debug mode. Instead, press F5 or select build | start debug | go from the menu to make the simulator in debugging mode.

When you run a visual C ++ project Simulator for the first time, a dialog box appears asking you about the executable file name. Navigate to the epoc32releasewinsudeb file in the root directory of sdk.

  Run the simulator in Borland C ++ Builder 6 and C ++ builderx ide

You can use the tools | mobile build Tools menu option and select Run emulator to start the debugging version of the simulator. You can also use the run | run menu option (F9), but it will cause the project to be re-created every time-and this may take a long time. When using this option, you may need to terminate the create dialog box ("Compiling") before the simulator starts ").

If you run the simulator in C ++ builderx, use the run | debug project menu option or press SHIFT + F9. If you want to recreate the project and start the simulator, select Run | run project or press F9.

  Run the simulator in codewarrior ide

Select the project | run menu option or press Ctrl + F5 to run the simulator. Press F5 or use the project | Debug menu option to run the simulator in debug mode.
Locate and run applications

Click the icon on the simulator, or use the PC keyboard cursor (arrow) to navigate and select the helloworld application. Click the "selection" button (in the middle of the cursor control key) to start the application.

Note:

An application without a specific icon (specified in the. AIF file) will be assigned a default icon, which looks like a jagged disk.

In some sdks/IDES (such as Borland and codewarrior versions), your applications may be located in the "other" folder, not on the primary desktop. If this happens, navigate to the other folder and click "selection. In the left-side Navigation Pane, select the helloworld application and click "selection" to call the application.


Figure 1-5. "helloworld" Application

  Debug the application

Instead, you can put the application running on the simulator in debugging mode in IDE-this process is verified by the IDE in use. In typical cases, you need to set a breakpoint in the appropriate position of the source code.

Start the simulator in debugging mode. Because you need to debug an application (essentially a dynamic link library DLL), rather than the simulator itself, you need to navigate and run the application. The application will start and the execution will stop when the breakpoint you set is reached. Then you can use your own ide tool to gradually execute the source code of the application.

  More ide help

This article does not provide more information about different ide functions. Therefore, if you want to query more ide help information, you can use the Help menu option.

For Microsoft Visual C ++, you can select the help | contents menu option, which is provided in msdn installed with IDE.

For Borland C ++ Builder 6, you can use the Help menu option. In addition to the standard Borland help file, you will find an independent help | Borland C ++ mobile edition help page. For C ++ builderx, you can select help | Help topics, and then select mobile development.

For metrowerks codewarrior, there is a help | online manuals menu option, which contains a large amount of valuable information when using Symbian OS.

More specific ide information can be obtained online. For example, go to http://msdn.microsoft.com/chaincheck to find visual c ++ information, go to http://bdn.borland.com/chaincheck to find Borland C ++ information, and go to tracing. C ++ SDK + Symbian development getting started Deployment developer online builder.com.cn updated on:2007-12-28Author: Tao gang compilation Source: Tianji net Keyword: C ++ SDK Symbian deployment the application program passed to the target hardware in the form of a Symbian installation system (. SIS) file .. The sisfile is a compressed archive file that contains all the files required for installation and the installation options. The Symbian installation system provides a simple and consistent user interface for installing applications, data, or configuration information on devices based on the Symbian operating system. Components installed by developers (or end users) are included in the. sisfile.

We can use the interactive tool SISAR provided by the Series 60 SDK to generate the. sisfile. To easily install applications on the target hardware, SISAR packages all application files to a. sisfile.

All required information for creating the installation (. SIS) file is provided in the sample project helloworld -- they are located under Install Folder. In the example project, we use a dedicated installation package source file (helloworld.pkg.pdf and Symbian tool makesis.exe.

  Create an SIS Installation File

After you build the armi release version of The helloworld application, You Need To package all application components into an installation package (. SIS) file. Open the command prompt and navigate to the SDK folder of the helloworld project. Switch to install folder, and enter the following content to create the. sisfile:

Makesis helloworld. PKG

After successful creation, a message similar to "created helloworld. Sis" will be output. The installation package (. SIS) file will be created under Install Folder. Now you must transmit the data to the device.

  Sisfile Installation

You can choose among the three potential installation options, depending on the device you are using and other available tools-for example, whether you can access the PC through an infrared or bluetooth device, or access some software based on Symbian connect (Nokia PC Suite, Or something provided by other device vendors:

· Install. the application installation process of Series 60 devices is completed by establishing a connection between the PC and the target device through the infrared or bluetooth conversation between the software (such as Symbian Connect.

· Install and transfer the. sisfile from any device (such as a PC, a Symbian OS phone number, or any other device that can use obex) through obex (Object Exchange) via infrared or Bluetooth. This process can be managed by the messaging application, which can intercept files attached to messages-when you open a message, it will automatically start the application installation process on the phone.

· As an option, the. sisfile can be sent as an email attachment. Application installation is also managed by the messaging application on the phone. When you open the message, it automatically starts the installer.

The previous two methods depend on establishing a connection between the PC of the development project and the Series 60 device. In typical cases, the device manufacturer provides the appropriate communication software. You must refer to the specific instructions provided by the connection software.

After the installation, the version of The. sisfile, which is greatly simplified, is retained on the Series 60 device to control the uninstallation of the application. If necessary, use the application "manager )". This simplified. sisfile only contains the information required to uninstall the application, which is typically much smaller than the original file.

If the. sisfile is transmitted as a message attachment and the original message is not deleted from the inbox folder of the messaging application, the original. sisfile may also exist on the device.

  Run on the target device

Use one of the preceding methods to transmit the helloworld. sisfile to the target hardware. After the transfer, you can install the application on the device. Run the application as listed in "locate and run the application. You will be sure that the application located and running on the target device is the same on the simulator-there is only one small difference: the application is not located in the "other" folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.