bada Tutorial: Development Environment (bada Developer Site, SDK, UI Builder, Testing Tool, UI Sequencer Tool

)

bada 1.2.0 Copyright © Copyright © 2010 Samsung Co., Ltd. All Co., Ltd. All rights reserved. 2010 Samsung Electronics Electronics rights reserved. 1

Contents
• • • • • • • • From Conception to Release Application Development Process Developer Site SDK UI Builder bada Testing Tool bada UI Sequencer Tool FAQ

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

2

From Conception to Release
The bada SDK and tools provide everything you need to manage your application life-cycle from product conception, through development, release, and end-of-life application retirement.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

3

bada.Application Development Process  Developer Site (developer.  Test your application. All rights reserved.com) • Write code in IDE • Design UI with UI Builder • Build. 4 . debug. and test on device • Create package and deploy  Registration for Certification • • • • • Verify and validate application Certify application Sell application Check sales statistics Remove application • Remove application Product Unregistration Copyright © 2010 Samsung Electronics Co.  Sell your application. debug.  Samsung Apps Seller Office (seller.xml  • Run Application Wizard  Create your application ID. and test with Simulator • Build. Ltd..samsungapps.  Write your application.com) • Sign up • Generate a new application profile • Set application version • Select privileged groups to use • Set up bada components • Select application features Download SDK SDK Application Development Process: Download manifest.

5 . All rights reserved. Ltd.Developer Site Copyright © 2010 Samsung Electronics Co..

Contents • • • • • • • Overview Managing Your Applications Generating New Application Profiles Assigning Privilege Groups Setting up bada Components Selecting System Requirements Downloading the Manifest File Copyright © 2010 Samsung Electronics Co. Ltd.. All rights reserved. 6 .

Copyright © 2010 Samsung Electronics Co.Overview (1/3) bada Developers is a developer site that helps you develop and manage your application life-cycle.0. • Privilege group information is included in your application‟s manifest. In it.1 to 35.. – You can revise the application version number as your application matures and is upgraded. you can: – Generate new application profiles: • Name your application. The supported range of application version numbers vary from 0. All rights reserved.1295.0. 7 . – Assign privilege groups: • Assign privilege groups to your application to access specific functionality provided by privileged APIs.0 by default. for your application. such as custom profiles. • Get your unique application ID.35. Ltd. content types and categories. • Set your application version number. and workspaces.xml. – The application version number is set to 1. – Set up bada components: • Configure bada components.

– Download manifest. All rights reserved. • Selected application features are included in your application‟s manifest. privileges.xml for use in Eclipse IDE. application features. Ltd.Overview (2/3) – Select system requirements: • Select minimum device requirements.xml: • Download manifest. 8 . • The manifest.xml. and other design and runtime information.xml file contains the application ID. Copyright © 2010 Samsung Electronics Co. and other hardware or software specifics to limit device model searches. screen size. • Select CPU type. 3D accelerator version..

Overview (3/3) 1. Download manifest. Generate New Application Profile 2. Assign Privilege Groups 3. Ltd.. Set up Components 4. Select System Requirements 5. All rights reserved. 9 .xml Copyright © 2010 Samsung Electronics Co.

Step 5. your application is for sale. Generate your application profile. You can generate and develop your application on the bada developer site as the first step. Perform the other steps at the Seller site. Request certification for your application. Step 4.. Submit your application to the Seller site. Ltd. Step 3. Copyright © 2010 Samsung Electronics Co. 10 . End of sale. Step 2. Now. All rights reserved.Managing Your Applications There are 5 steps to sell your application: Step 1.

Generating New Application Profiles (1/2) Samsung Mobile Innovator.. All rights reserved. Ltd. 11 . Copyright © 2010 Samsung Electronics Co.com Select application type. Enter application version.

The application ID is created when you generate an application profile. Ltd.Generating New Application Profiles (2/2) Samsung Mobile Innovator. each application needs a unique identifier. For basic configuration settings and life-cycle management.. All rights reserved. 12 . Copyright © 2010 Samsung Electronics Co.com Enter application name.

13 . Copyright © 2010 Samsung Electronics Co.. Ltd.Assigning Privilege Groups Select privilege groups. This is similar to how you declare which namespaces your application uses. Assign privilege groups to your application to include specific feature sets. All rights reserved.

All rights reserved..Setting up bada Components Click the component to configure. Ltd. Click the name of a component to configure it in a new window. 14 . Add and configure different bada components for your application. Copyright © 2010 Samsung Electronics Co.

All rights reserved. Select the targeted device needed by your application. 15 .. Copyright © 2010 Samsung Electronics Co. Select hardware or software features needed by your application. Ltd.Selecting System Requirements Define the system requirements by selecting the features that your application requires (to see the devices that have the features you want) or by selecting the device you want to develop an application for.

All applications require a manifest file that contains information specific to the platform. Copyright © 2010 Samsung Electronics Co.Downloading the Manifest File Download your manifest file. 16 .. software. hardware. including the application ID. and application. All rights reserved. Download the manifest. Ltd.xml file for your application here.

Ltd. 17 . All rights reserved..SDK Copyright © 2010 Samsung Electronics Co.

18 ..Contents (1/2) • Overview • SDK Prerequisites • Installing the SDK – Installing New Plug-ins – Updating the bada SDK • Starting the IDE • Development Process with the IDE – – – – – – – Importing Sample Applications Creating Applications Coding Applications Setting Application Properties Building Applications Checking API Violations Checking Privilege Violations Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved.

Ltd.. 19 . All rights reserved.Contents (2/2) – Debugging Applications • • • • • • Installing a Device Driver for Test Devices Installing the Test Root Certificate Setting the Target Device to Debug Mode Checking Debug Messages Getting Debug Information Stopping the Debug Process – Running Applications • Checking Output Messages • Exiting Applications – Checking Memory Usage – Testing Applications • Manipulating Simulator • Testing Applications with Remote Test Lab • Error Codes – Packaging Applications • Packaging Applications on Command Line – Upgrading Applications • • • IDE Text Editor Resource Monitor Output Copyright © 2010 Samsung Electronics Co.

All rights reserved.. Ltd.Overview • Prepare for application development: – Download the bada SDK from the bada developer site. – Install the SDK. • bada SDK: – – – – – – Platform binaries and libraries Header files Simulator Documentation Sample applications bada IDE: • Eclipse CDT-based (C/C++ Development Tools) – – – – – Application Wizard UI Builder / Resource Explorer Resource Monitor bada Testing Tool bada UI Sequencer tool Copyright © 2010 Samsung Electronics Co. 20 .

21 .4 GB RAM or higher 1.0 or higher • Firefox 3. you need: – Computer with : • • • • • Microsoft Windows® XP. – Web browser to access the bada developer site.8 GB free disk space or higher Local administrator rights Note that the Simulator screen size is 480 x 800. Windows® Vista or Windows® 7 1.SDK Prerequisites To install and run the bada SDK.. Copyright © 2010 Samsung Electronics Co. The supported Web browsers include: • Internet Explorer 6. Ltd. this is due to the Windows operating system. Screen resolutions under 800 do not show normally for OpenGL® applications. All rights reserved. This is not a defect.2 or higher – The bada membership to download the SDK from the bada developer site.0 or higher • Safari 3.

Instead. 2. the SDK is installed and configured.exe. bada_SDK_<version>. All rights reserved. download the bada_SDK_<version>_<model>_LP#. 3. Select the required language packs and click Next. • If you need to add more language packs to your SDK later on. since it can cause problems for your development environment.Installing the SDK • The SDK uses a standard installation wizard. 2. Copyright © 2010 Samsung Electronics Co.exe patch installation packs you need from the bada developer site and run the corresponding language pack installers. Click Install.. Download the SDK installer. Ltd. Run the SDK installer. To install the SDK on your development machine: 1. do not reinstall the SDK with the SDK installer. • Once the SDK installer is finished. from the bada developer site. 22 .

com/feature-update/ as the software site that you work with.Installing New Plug-ins You can install new plug-ins for the bada IDE: 1. 23 .. In the bada IDE. All rights reserved. Select the plug-ins to install and click Next to continue and complete the installation process. Ltd. 2. go to Help > Install New Software. Copyright © 2010 Samsung Electronics Co.bada. Select http://static. 3.

click OK to ignore it. Ltd. Copyright © 2010 Samsung Electronics Co. All rights reserved. • With the bada SDK Updater installed.. – When a security warning dialog is displayed. 24 . the bada IDE checks for SDK updates or new SDK versions each time it starts.Updating the bada SDK • Install the bada SDK Updater by going to Help > Install New Software in the bada IDE.

Click this icon to go to the development view Copyright © 2010 Samsung Electronics Co. Ltd.. All rights reserved. – When you start the IDE for the first time. a welcome page is displayed with more information on bada and on developing applications with the bada IDE. If you start with a new version of the IDE. do not use a workspace created for a previous IDE version. 25 . – Start bada IDE and specify a workspace folder.Starting the IDE You can start developing a new bada application with bada IDE.

26 . Ltd.. All rights reserved.Development Process with the IDE  Develop mobile application IDE  Run in Simulator to test Platform Simulator Event Injector Application Wizard  Run on target device to test IDE ZIP  Build UI UI Builder  Package to obtain certification at Samsung Apps Seller Office Copyright © 2010 Samsung Electronics Co.

All rights reserved. Ltd.Importing Sample Applications (1/2) Right-click on sample to be imported and click Copy into my workspace… in bada SDK Samples. 27 .. Copyright © 2010 Samsung Electronics Co.

28 . Copyright © 2010 Samsung Electronics Co. 2.Importing Sample Applications (2/2) You can load bada SDK samples with the following steps: 1. All rights reserved. Ltd. Go to Window > Show View > Other… Select bada > bada SDK Samples..

) • Go to File > New > bada Application Project. Ltd. check and set settings. and click the Next button. All rights reserved. In each window. Choose a project type. The project creation process in the IDE consists of multiple windows. 29 . (Check if the current perspective is bada C++. • New application projects automatically fill in basic code and let you configure the project for different build configurations and devices.Creating Applications (1/10) • You can create new bada applications with existing application templates.. Give a name to your project. Copyright © 2010 Samsung Electronics Co.

bada Flash Based Applications: • This template is suitable for creating a simple project based on a flash file. Copyright © 2010 Samsung Electronics Co. bada Web Based Application • This template is suitable for creating a simple project based on HTML. Ltd. 4. 1.. • It contains the basic application functionality as well as the functionality for displaying a flash file on the device screen. All rights reserved. bada Empty Project: • This template is suitable for creating a project with only project files without any source or include files. 30 .Creating Applications (2/10) There are several bada project types. It is used for importing the existing source files. 2. • It contains the basic application functionality as well as the functionality for drawing a form on the device screen. bada Form Based Applications: • This template is suitable for creating a simple project based on a form. and CSS files. 3. • It contains the basic application functionality as well as the functionality for loading HTML files in a Web control. JavaScript.

31 .Creating Applications (3/10) 5. 6. Therefore. bada Shared Library: • This template is suitable for creating an application library with shared libraries. All rights reserved. Copyright © 2010 Samsung Electronics Co. you must define the path to the libraries in the project settings. you must define the path to the libraries in the project settings. Therefore. When you build the project. you must make sure that the Linker of the IDE can access the external libraries at the build time. you must make sure that the Linker of the IDE can access the external libraries at the build time. bada Static Library: • This template is suitable for creating an application library with static libraries. • If you select this template.. the IDE creates the links to the external static libraries. Ltd. the IDE creates the links to the external shared libraries. When you build the project. • If you select this template.

select the Default manifest file check box. and browse to the downloaded file. An application with the default configuration cannot be sold at Samsung Apps. on the Device Configurations page. • On the Select bada SDK page: – – Copyright © 2010 Samsung Electronics Co. and you must select a model with the same API version as in the manifest file. Check that the device model and the related API version for which you are developing your application are correct. Check that the path to the bada SDK root is correct. Ltd. All rights reserved.. clear the Default manifest file check box. Then.Creating Applications (4/10) • On the Device Configurations page: – – To use a default device configuration.xml file contains the API version of the application. The manifest. 32 . first create and download a manifest file on the bada developer site. To use a new manifest file.

– For flash based applications. 33 . After you have created the application. enter the form name. you can modify the layout of the flash file using the UI Builder.. enter the form name and browse to the flash file. Form Based Application Flash Based Application Copyright © 2010 Samsung Electronics Co.Creating Applications (5/10) • On the Generated Files page: – This page is displayed only for form and flash based applications. All rights reserved. Ltd. – For form based applications.

All rights reserved. Copyright © 2010 Samsung Electronics Co. The trusted applications have read and write access to the Share2 folder of your application.. Ltd.Creating Applications (6/10) • On the Trust App Settings page: – To enable file sharing with other applications. add their application IDs to the list of trusted applications. 34 .

select a base resolution from the Base Resolution drop-down list. – If you enable auto-scaling.. 35 . All rights reserved. Copyright © 2010 Samsung Electronics Co.Creating Applications (7/10) • On the Auto-scaling Settings page: – Select the Auto-scaling check box to enable your application to scale automatically and match the device resolution. Ltd.

• On the Select Configurations page: – Select the device configurations for the application deployment scenarios. Ltd. All rights reserved. 36 . Copyright © 2010 Samsung Electronics Co.Creating Applications (8/10) • On the Basic Settings page: – Enter a description for your application..

Copyright © 2010 Samsung Electronics Co.Creating Applications (9/10) • On the Summary page: – Verify the settings for your new application and click the Finish button. Ltd. 37 .. All rights reserved.

‟ prefix are copied to /src. • UI Builder files are created in this folder. All rights reserved. /Home • Readable and writable files and folders for your application are copied to this folder. /Home and /Res. /inc. they are ignored and are not copied to the target device. • It is accessed by /Home in source code. • The „Share‟ folder name cannot be created in /Home because it is a reserved folder.. /src has source files created by the application wizard. Ltd. 38 . /inc has include files created by the application wizard. – Although files and folders with a „.Creating Applications (10/10) Project Folder Structure – – – – /Includes refers to the bada platform include files. Copyright © 2010 Samsung Electronics Co. – /Res • Read-only files and folders for your application are copied to this folder. • It is accessed by /Res in source code.

you must include FApp.Coding Applications (1/3) Add include files: – Required include files are listed under Remarks in the bada API Reference.h as shown under Remarks on the Osp::App page. Copyright © 2010 Samsung Electronics Co. if your application uses classes in Osp::App::AppControl. All rights reserved. – For example.. 39 . Ltd.

40 . if your application uses classes in the Osp::App namespace.Coding Applications (2/3) Add namespaces: – Namespaces are listed in the bada API Reference. Copyright © 2010 Samsung Electronics Co. you must add „using namespace Osp::App‟ in your CPP files. – For example. All rights reserved. Ltd..

All rights reserved. UTF-8 in case of Korean).. 41 . – Select an applicable value from the Other drop-down list (for example. Copyright © 2010 Samsung Electronics Co.Coding Applications (3/3) Change the encoding format for your source files if the source files include UNICODE text: – Right-click the project and select Properties > Resource. Ltd.

. • The manifest. – Select a destination model for developing your application in the selected SDK root. 42 . Select an SDK path.Setting Application Properties (1/12) You can select an SDK root and a model: – Select an SDK path among installed SDKs. • The latest installed SDK is the default SDK root. All rights reserved. Ltd.xml file contains the API version of the application. Select a model Copyright © 2010 Samsung Electronics Co. and you must select a device model with the same API version as in the manifest file.

Setting Application Properties (2/12) You can set various application information.. To enable file sharing with other applications. Set application names corresponding to each language Do not remove the “English” title. It is necessary. Set the auto-scaling configuration. such as adding icons and defining the autoscaling and file sharing options: – Right-click the project and select Properties > bada Build > Application Information. Set icons Change the default icon images to images that suit your application. Ltd. Set auto-scaling Set trust app Copyright © 2010 Samsung Electronics Co. 43 . add their application IDs to the list of trusted applications. Make sure the entry name is identical to the name of the executable binary. All rights reserved.

The image is displayed during application initialization. The image is displayed on the quick panel when the application receives an event. maintain a 1-pixel margin on all four sides of the icon. Copyright © 2010 Samsung Electronics Co. 2 To display the icon appropriately..Setting Application Properties (3/12) Add the icons based on the descriptions given in the table below: Icons MainMenu (A)2 Setting Ticker (B)3 QuickPanel (C) LaunchImage (D) Mandatory Yes No No Yes Format 32-bit PNG with alpha 32-bit PNG with alpha 32-bit PNG with alpha JPEG or PNG Size1 Type 1: 100 x 96 Type 2: 50 x 47 Type 1: 32 x 32 Type 2: 18 x 18 Type 1: 68 x 74 Type 2: 34 x 37 Type 1: 480 x 800 Type 2: 240 x 400 Description The image is displayed on the main menu. 1 Type 1 refers to images for the WVGA resolution. 3 To display the icon appropriately. 44 . while type 2 refers to images for the WQVGA resolution. Ltd. maintain a 1-pixel margin at the top of the icon. All rights reserved. Reserved The image is displayed on the indicator area when the application receives an event.

45 . you must rebuild the application. Copyright © 2010 Samsung Electronics Co. Ltd.Setting Application Properties (4/12) You can change the manifest file: – To change the manifest file: • Right-click the project and select Properties > bada Build > Manifest Information. • Click Import and select the file to be used.. All rights reserved. – You can also change the manifest file by simply dragging and dropping a new file onto the root project directory in the Project Explorer view. – If you change the manifest file.

46 . 2.. Ltd. Select a configuration and add include paths. Copyright © 2010 Samsung Electronics Co.Setting Application Properties (5/12) You can add include paths for your application: 1. All rights reserved. Right-click the project and select Properties > C/C++ General > Paths and Symbols.

47 .Setting Application Properties (6/12) • You can add bada libraries. – For example. to the library list. but you need to add the other required libraries manually. is added automatically by the application wizard. you must add the required libraries. if your application uses OpenGL® ES. • The default bada library. Copyright © 2010 Samsung Electronics Co. FOsp. All rights reserved.. shown in the bada API Reference under Remarks. external libraries. and library search paths for your application. Ltd.

All rights reserved. 2. Right-click the project and select Properties > C/C++ Build > Settings. Ltd. • Add library names without file extensions (for example. FGraphicsOpengl). Add libraries Add library paths Copyright © 2010 Samsung Electronics Co. Select the Simulator-Debug configuration and add library search paths and libraries..Setting Application Properties (7/12) To add library search paths and libraries for the Simulator-Debug configuration: 1. 48 .

• For example..Setting Application Properties (8/12) To add static libraries for the Target-Debug or Target-Release configuration: 1. 49 . Right-click the project and select Properties > C/C++ Build > Settings > bada C++ Linker > Miscellaneous. Select a configuration and add libraries. 2.a Add libraries Copyright © 2010 Samsung Electronics Co. add ${TARGET_LIB_PATH}/YOUR_LIBRARY. All rights reserved. Ltd.

Add library names without prefix and file extensions (for example.Setting Application Properties (9/12) To add shared libraries for the Target-Debug or Target-Release configuration: 1. All rights reserved.. 2. Right-click the project and select Properties > C/C++ Build > Settings. Add libraries Add library paths Copyright © 2010 Samsung Electronics Co. • • The file name of shared libraries must start with “lib” (for example. Select the Target-Debug or Target-Release configuration and add library search paths and shared libraries. LIBRARY). libLIBRARY. 50 . Ltd.so).

also copy them to the \<BADA_SDK_HOME>\Model\<Device_model>_LP#\Simulator folder. To use the shared libraries in the Simulator. Add the library search path and the shared libraries at Properties > C/C++ Build > Settings > bada C++ Linker > Libraries.Setting Application Properties (10/12) To add shared libraries to the file system of the Simulator or the target device: 1. Copy the shared libraries to the newly created lib folder. 3. Create a lib folder in your project folder. 2.. 51 . All rights reserved. Ltd. Copyright © 2010 Samsung Electronics Co.

• The check is automatically performed when you build the application. If the application has conflicting API versions. Ltd.. Copyright © 2010 Samsung Electronics Co. Select the API check check box. 2. 52 . Right-click the project and select Properties > bada Build > Build Options.Setting Application Properties (11/12) • The versions of API used in the manifest file and your application must match. All rights reserved. the build fails and the results are displayed in the Problems view. To enable the version match check: 1.

Ltd.. Right-click the project and select Properties > bada Build > Build Options. 2. Copyright © 2010 Samsung Electronics Co. Select the Privilege check check box. To enable the privilege check: 1.Setting Application Properties (12/12) • You can check the source code in your project for any violation of privileges. and the results are displayed in the Problems view. All rights reserved. 53 . • The check is automatically performed when you build the application.

Ltd..Building Applications (1/2) Building applications is essentially the same as for non-mobile applications. Samsung bada adds in an additional Simulator build for testing on your local machine. speeding up your development time. All rights reserved. 54 . Build Run in Simulator or on Device Copyright © 2010 Samsung Electronics Co.

Building Applications (2/2)
To build your application:
1. Select a build configuration. There are separate configurations for debugging and testing the application on the Simulator or the target device, and for creating the release build.

2.

You can build your project using the Build Project menu item.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

55

Checking API Violations
• You can check the source code in your project for any violation of APIs, such as incompatibilities between the defined API version and the used APIs:
1. Build the project. 2. Select Project > API Check.

• The check results are displayed in the Problems view. • Note that the API check can also be performed automatically during the building process. For more information, see the Setting Application Properties slides in this tutorial.
Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 56

Checking Privilege Violations
• You can check the source code in your project for any violation of privileges:
1. Build the project. 2. Select Project > Privilege Check.

• The check results are displayed in the Problems view. • Note that the privilege check can also be performed automatically during the building process. For more information, see the Setting Application Properties slides in this tutorial.
Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 57

• The debugging environment uses GDB (GNU Debugger) for both the Simulator and target device. • For more information about GDB.html.org/software/gdb/gdb. You can set breakpoints.Debugging Applications (1/4) • You can expect debugging to be essentially the same as with other development that you do. and step over breakpoints. All rights reserved. – Refer to Help Contents: C/C++ Development User Guide > Tasks > Running and debugging projects > Debugging. step out. Copyright © 2010 Samsung Electronics Co. GDB can debug both locally and remotely.. and watch variables. see http://www.gnu. Ltd. step in. 58 . • Debugging with bada IDE is same as with Eclipse CDT.

• • To debug the application on the Simulator. To debug the application on your target. right-click the project in the Project Explorer and select Debug as > bada Target Application. right-click the project in the Project Explorer and select Debug As > bada Simulator Application. 59 . Copyright © 2010 Samsung Electronics Co. All rights reserved. Ltd.Debugging Applications (2/4) • You can debug an application on the Simulator as well as the target device..

60 . – The only latest application installed by bada IDE can be executed from the main menu.Debugging Applications (3/4) • The limitations for debugging in the target are: – Due to hardware limitations. All rights reserved. after clicking the Suspend button and some other button. – An application is suspended only after clicking the Suspend button followed by some other action in the application. Copyright © 2010 Samsung Electronics Co. For example. Ltd. as defined in the table below: Model Wave WaveWQ Maximum number of breakpoints 10 10 – You cannot insert watchpoints to monitor the variables used in your application. you can insert only a limited number of breakpoints..

Debugging Applications (4/4) • You cannot use the Step Into option (A) for target debugging.dll library. cannot be determined unless they are loaded in the memory. – The program counter has problems when stepping out during debugging in OspMain() because OspMain() is the entry point for bada applications. in the debugging mode. and the upper call stack is the Windows ntdll. which means that the addresses of the symbols.cpp. 61 . bada applications are built using the -fpic GDB command. A B • Caution: – Do not step out during debugging inside of OspMain() in <ProjectName>Entry.. To examine the application as it steps into disassembled code. Copyright © 2010 Samsung Electronics Co. such as variables and APIs. enable Instruction Stepping Mode (B). Ltd. All rights reserved.

The Hardware Update Wizard is shown twice for 2 modem ports. • Connect the test device to your computer with a USB cable.exe. • Check if there are the 2 modem ports in Device Manager. – Browse the folder with the device driver..zip in <BADA_SDK_HOME>\Tools and run Setup. – Select Install from a list or specific location (Advanced). 62 . • Select a folder for the driver location in the Hardware Update Wizard. – “Samsung Mobile Modem Diagnostic Serial Port V2 (WDM)” in Port. – “Samsung Mobile Modem in V2” in Modem. Copyright © 2010 Samsung Electronics Co. Ltd.Installing a Device Driver for Test Devices • Extract <model>-<driver>-<version>. – Check Include this location in the search. All rights reserved.

0 or higher) (C).0) or USB utilities (in a device supporting SDK version 1. Tap Connectivity (B). you must install the test root certificate to the target device.2. The application cannot be installed or run on the target device without the test root certificate. C 63 .. On the target device. 2. 1. Tap USB (in a device supporting SDK version prior to 1. 3.Installing the Test Root Certificate (1/4) For testing an application on the target device during development. tap Settings (A). Ltd.2. A B Copyright © 2010 Samsung Electronics Co. All rights reserved.

0: Tap Mass storage and Set (D)..2.Installing the Test Root Certificate (2/4) 4. 5. Select the mass storage: • In a device supporting SDK version prior to 1.0 or higher: Tap Mass storage and Back (E). D E Copyright © 2010 Samsung Electronics Co.2. 64 . Connect the target device to your computer. All rights reserved. • In a device supporting SDK version 1. Ltd.

9. tap My files (F). On your computer. All rights reserved.Installing the Test Root Certificate (3/4) 7.. Disconnect the target device from your computer. 8. • The removable disk is connected to the target device. copy the \<BADA_SDK_HOME>\Tools\sbuild\rootCACert. 65 .cer file to Removable Disk\Others. Ltd. On the target device. Tap Others (G). F G Copyright © 2010 Samsung Electronics Co. 10.

When the installation is completed.. H I J Copyright © 2010 Samsung Electronics Co. Tap Install (I). All rights reserved.Installing the Test Root Certificate (4/4) 11. Tap rootCACert. Ltd. a message “Installed” is displayed on the screen (J). 66 .cer (H). 12.

Ltd.0: Select Settings > Connectivity > Mass storage > USB debugging. Copyright © 2010 Samsung Electronics Co. • .2.0 or higher: Select Settings > Connectivity > USB utilities > Debugging.Setting the Target Device to Debug Mode Set your target device to the debug mode: – In a device supporting SDK version prior to 1. 67 .2.. – In a device supporting SDK version 1. All rights reserved.

org/software/gdb/gdb. – With the GDB console.Checking Debug Messages (1/2) You can check debug messages in the Console view.html. you can also execute GDB commands.. For more information about GDB commands. see http://www. 68 . All rights reserved. Display Selected Console button GDB command Log messages GDB command Copyright © 2010 Samsung Electronics Co. Ltd.gnu. – Click the Display Selected Console button and select the option containing gdb.

3.Checking Debug Messages (2/2) You can also display verbose GDB output in the Console view: 1.. 69 . 2.. Copyright © 2010 Samsung Electronics Co. Right-click a project in the Project Explorer and select Debug As > Debug Configurations.. Ltd. On the Debugger tab.. Click Debug. All rights reserved. select the Verbose console mode check box.

70 . All rights reserved. Copyright © 2010 Samsung Electronics Co.. Ltd.Getting Debug Information You can get debug information after the target terminates abnormally during debugging: – Debug information includes stack frame. – Select Project > Get Debug Information.

it exits when you click the Terminate button and then press some other button in the application. Copyright © 2010 Samsung Electronics Co. Ltd. For example. – An application exits only when the termination of the run operation is followed by some other action in the application. All rights reserved. 71 .Stopping the Debug Process To stop debugging: – Click the Terminate button in the Console or Debug view of the bada IDE. This terminates the run operation..

and data files are downloaded before starting the run. resource files.. and select Run As > bada Simulator Application. – To run the application using the Project Explorer: Right-click the project. – To run the application using the bada IDE menu: Go to Run > Run As > bada Simulator Application. Ltd. Copyright © 2010 Samsung Electronics Co. or Run As > bada Target Application. or Run > Run As > bada Target Application. All rights reserved.Running Applications (1/3) You can run an application on the Simulator or the target device: – The executable binary. – The application is installed automatically while it runs. 72 .

3. and data files on the target. Right-click a project in the Project Explorer and select Run As > Run Configurations. 2... Ltd. Click Run. All rights reserved. Copyright © 2010 Samsung Electronics Co. 1. resources. 73 . you can download the executable binary to your target without updating the other files.. Clear Overwrite icons.Running Applications (2/3) If only the source code (not the resource files) has been changed..

Ltd. Click Run.Running Applications (3/3) If only the resource files (not the source code) have been changed. 2. 74 . All rights reserved. 3. Copyright © 2010 Samsung Electronics Co.. Clear Overwrite binary files on the target. 1.. Right-click a project in the Project Explorer and select Run As > Run Configurations. you can download the modified files to your target without updating the binaries...

All rights reserved. Ltd.Checking Output Messages • Start the Output view by selecting Window > Show View > Other… > bada > Output. • The Output view functions similarly with the Simulator and the target device. Copyright © 2010 Samsung Electronics Co.. 75 .

76 . Ltd. For example.. Copyright © 2010 Samsung Electronics Co. • To exit applications on the target device: – Press the End key on your target device to exit your application easily. it exits when you click the Terminate button and then press some other button in the application.Exiting Applications • To exit applications in the bada IDE: – Click the Terminate button in the Console or Debug view to terminate the run operation. All rights reserved. – An application exits only when the termination of the run operation is followed by some other action in the application.

Checking Memory Usage (1/3) To enable memory usage checks of your application: 1. In the left side menu.. All rights reserved. you can create the configuration by right-clicking bada Simulator Application and selecting New. 3.. 77 . Ltd. Right-click a project in the Project Explorer and select Run As > Run Configurations. or Debug As > Debug Configurations. If not. Click Run or Debug.. select the Check memory usage check box. On the Main tab.. 2. Copyright © 2010 Samsung Electronics Co... the configuration is visible after your application has been executed by the bada Simulator Application configuration.

78 . Ltd. the Problems view displays the following memory usage information: – Memory leaks – Incorrect memory usage due to inconsistent method calls used for allocating and deallocating memory space For example.Checking Memory Usage (2/3) After the application is terminated. – Memory profiling Copyright © 2010 Samsung Electronics Co. the memory allocated using malloc or new subroutines is not released using free or delete.. All rights reserved.

On the Tool Settings tab. Copyright © 2010 Samsung Electronics Co. libc-newlib. To save the settings.Checking Memory Usage (3/3) • Memory usage information is displayed properly only if the linking order of the libraries is osp_rt0.. To rearrange the order. Ltd. 3. All rights reserved. and FOsp. • To check the linking order: 1. select the library and click Move Up or Move Down. Check the order of the libraries under Libraries (-l). 2. 4. click Apply. Right-click the project in the Project Explorer and select Properties > C/C++ Build > Settings. select bada C++ Linker > Libraries. 79 .

. You do not need to upload applications to target devices to run or test your applications. You can even simulate environmental conditions for device sensors: – – – – – Call SMS Battery Antenna Sensors • • • • • Location Accelerometer Magnetic Tilt . Debugging is done with native debuggers.Testing Applications • • • The Simulator provides a fast and efficient testing environment right on your local machine. Copyright © 2010 Samsung Electronics Co. All rights reserved.. Inject arbitrary event data into device simulator Note: The Simulator‟s Event Injector supports only English. The Simulator‟s Event Injector lets you artificially create and use any data you need. 80 .. Ltd.

81 . All rights reserved.. Ltd.Manipulating Simulator (1/2) • The Simulator is used in developing applications as it gives you execution control using native debuggers. Side Up and Down Key: Volume control Camera Key: Launch camera Home Key: Use long press to switch between applications Copyright © 2010 Samsung Electronics Co.

Manipulating Simulator (2/2)
The Simulator menu lets you easily control the Simulator environment.
– Event Injector: Launch the Event Injector.
• For detailed information about the Event Injector, see the bada Developer Guide.

– Rotate: Switch between portrait and landscape mode.
• The application must implement this feature in order to support rotation.

– Error Lookup: Retrieve a system error message based on the value entered. – Update Content DB: Register the newly added files in the Media folder. (This option only works on the idle screen.) – Options:
• Always on Top: Set the z-order to the top. • Size: Adjust the Simulator size.
Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved. 82

Testing Applications with Remote Test Lab (1/6)
• Remote Test Lab (RTL) allows you to install and test applications on Samsung devices over the Web. With RTL, you can run applications with a real device instead of the Simulator or local device. • To use RTL, you must install the RTL Eclipse plug-in. 1. In the bada IDE, go to Help > Install New Software.... 2. Select http://rtl.innovator.samsungmobile.com/rtl-update as the software site you work with. 3. Select the plug-ins to install and click Next to complete the installation process.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

83

Testing Applications with Remote Test Lab (2/6)
• To start testing applications, you must log in to RTL:
1. Do one of the following:
• • Click the Login RTL Server button. Go to RTL > Login RTL Server.

2. Enter your user ID and password of the bada developer site (http://developer.bada.com). RTL is available to developer site members free of charge (regardless of the membership level). 3. After your login succeeds, a notification message is displayed.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

84

Phones and Help views open. The minimum period is 30 minutes (2 credits). The Reservations.. The maximum period is 10 hours/day (40 credits). Go to RTL > Open RTL View. One credit buys 15 minutes in RTL. select a device and drag and drop the bar in the time table to select the time period you want to reserve. All rights reserved.Testing Applications with Remote Test Lab (3/6) • To test applications. Ltd. RTL uses a credit system for the reservations: – – – – Every member receives 10 credits/day. Copyright © 2010 Samsung Electronics Co. you must make a reservation for at least one device in RTL: 1. In the Reservations view. 2. go to RTL > Open RTL View > Help View. • For more information. 85 . • To ensure fair access to all members.

• After the client starts. Copyright © 2010 Samsung Electronics Co. 2..zip files) on the device through the client. Ltd. All rights reserved.Testing Applications with Remote Test Lab (4/6) • To start the RTL client: 1. 86 . you can install and run packaged applications (. Select a device under My Reservations or Available Now and click Start. Go to RTL > Open RTL View > Phones View.

All rights reserved. Once the download completes.com. Ltd. Copyright © 2010 Samsung Electronics Co. 87 .Testing Applications with Remote Test Lab (5/6) • Starting the RTL client invokes Java Web Start. see http://java. 2. Click Open to start downloading the client module (runnable jar). • For more information about Java Web Start. click Run to start the application..sun. 1.

. 2. Build your project with the Target-Release build configuration. Click Run. Right-click a project in the Project Explorer and select Run as > Run Configurations. Copyright © 2010 Samsung Electronics Co. go to the Connection tab and select a reserved device from the drop-down list. On the Run Configurations window. • The executable binary. 4. Ltd. 3. 88 .Testing Applications with Remote Test Lab (6/6) • After reserving devices. resource files. and data files are downloaded before starting the run. All rights reserved. you can also run your application projects from the IDE directly without first packaging them and starting the RTL client: 1. The RTL client starts automatically. • The application is installed automatically while it runs.

All rights reserved.Error Codes (1/4) • An error code is assigned to every error. Copyright © 2010 Samsung Electronics Co.. 89 . Ltd. • Use the code to detect the nature of the error.

Ltd. Installation failed: Certificate has expired. The root certificate is required to build the certificate chain for the application integrity check. Installation failed: Invalid package..xml. The root certificate is not found on the device. The certificate is invalid in Signature. the derived certificate must be checked against the parent certificate before the actual installation. 90 . The certificate used to sign the application is expired. All rights reserved. There is insufficient storage space available for installing this application.Error Codes (2/4) The following table gives a detailed description for each error code: Error code 0101 0102 0103 Description Installation aborted: Another installation is in progress. Installation failed: Maximum number of applications reached. Installation failed: Certificate is revoked. The number of applications that are installed has reached the maximum limit. Installation failed: Certificate Parsing Error. The application cannot be installed properly because some of the package contents are invalid or missing. Installation failed: Insufficient storage. Uninstall some applications first and try again. Multiple applications cannot be installed at the same time. To perform the application integrity check. 0104 0105 0106 0107 0108 Copyright © 2010 Samsung Electronics Co. Installation failed: Failed to find root certificate.. The certificate used to sign the application is revoked according to the result of the OCSP protocol. Free some memory by removing unwanted media files or by uninstalling existing applications. Free some memory and try again.

Installation failed: Ticker icon missing. Installation failed: Application signature missing or invalid. Installation failed: Unknown Error The application installation failed due to an unknown reason.. Installation failed: Application metadata registration failed. The application manifest file specifying the application metadata is invalid or missing. This file specifies application details such as the application name and path to application icons. Description 0114 Installation failed: Invalid application information. Copyright © 2010 Samsung Electronics Co. The executable binary of the application is invalid or missing. Failed to register the privilege information to the system database during installation. Application metadata required to verify the application integrity is invalid or missing. The application's ticker icon is missing. Ltd. Installation failed: Application manifest missing or invalid. The application information file is invalid or missing. Installation failed: Setting menu icon missing. Installation failed: Quick panel icon missing. All rights reserved. Installation failed: Main menu icon missing.Error Codes (3/4) Error code 0109 0110 0111 0112 0113 Installation failed: Signature verification failed. The application's Setting menu icon is missing. Failed to verify the application signature. The application's main menu icon is missing. Installation failed: Invalid application executable file. Installation failed: Privilege registration failed. Application signature required to verify the application integrity is invalid or missing. The application's quick panel icon is missing. 91 0115 0116 0117 0118 0119 0120 .

All rights reserved. 92 . Installation failed: Setting menu icon name invalid. Ltd. Installation failed: Launch image name invalid. such as „key not found‟. Launch error: No License. Launch error: File(s) missing for signature verification. Failed to acquire the license during the DRM file installation. Installation failed: Main menu icon name invalid. Launch error: Signature verification failed. The file name of the quick panel icon cannot be extracted properly from the application package.Error Codes (4/4) Error code 0121 0122 0123 0124 0125 0126 0127 0128 0201 0202 0203 Installation failed: Launch image missing. Installation failed: License acquisition failed. Failed to decrypt the DRM package with the license file for some reason. Description Copyright © 2010 Samsung Electronics Co. The file name of the ticker icon cannot be extracted properly from the application package. Installation failed: Failed to decrypt DRM package. Installation failed: Ticker icon name invalid. Installation failed: Quick panel icon name invalid. The application's launch image is missing. Failed to verify the signature because the application binary or hash table file has been modified after installation. The file name of the main menu icon cannot be extracted properly from the application package.. The files required to check the hash table are missing. The file name of the launch image cannot be extracted properly from the application package. The file name of the Setting menu icon cannot be extracted properly from the application package. The license required to launch the application is missing or the PNUM does not match.

• Click the Make button. Select the files and folders to be included in the package. 2. 1. Ltd. Copyright © 2010 Samsung Electronics Co. • Go to Project > Make Package. 3.. Select Target-Debug or Target-Release as a configuration.Packaging Applications • You can create a new compressed bada application package to register in Samsung Apps. Enter a name for the package and select an output folder. 93 . All rights reserved. – Note: The IDE cannot directly install the created package to a target device. – Check the created package in the output folder.

Packaging Applications on Command Line You can also create a new compressed bada application package without the IDE by using MakePackage.. All rights reserved.exe – Command syntax: MakePackage.exe TYPE_OPTION PROJECT_PATH where TYPE_OPTION can be: • -s : Simulator-Debug • -td : Target-Debug • -tr : Target-Release – Command example: • MakePackage.exe through the command line. – File location: <BADA_SDK_HOME>\Tools\MakePackage\MakePackage.exe –tr C:\MyWorkspace\MyProject Copyright © 2010 Samsung Electronics Co. Ltd. 94 .

Copyright © 2010 Samsung Electronics Co. Packaged resource files are read-only..Upgrading Applications • If you need to upgrade your application after it has been certified at Samsung Apps for sales. User-created files and directories are not deleted. • When a previously installed application is upgraded on the device. All rights reserved. Application project folder /Home /Res /Bin Effect of the upgrade Application package files are overwritten. Register the upgraded application on Samsung Apps Seller Office. 2. you must: 1. They are replaced with the newly packaged application binaries. while keeping the user-created files and directories. They are replaced with the newly packaged resource files. you can decide which data files from the old version are kept and which are deleted. The common bada upgrade policy is to overwrite all the application package files. Application binaries are read-only. 3. Download an updated manifest file from the bada developer site. Repackage the application. 95 . Ltd.

and content assist (context-sensitive code completion). 96 .IDE Text Editor Eclipse provides a wealth of code editing tools in its text editor. including syntax highlighting.. All rights reserved. tabbed documents. code folding. Copyright © 2010 Samsung Electronics Co. All the CDT features are available. Ltd.

– Thread. and socket information.. timer. file. – Memory leak information. form. database.Resource Monitor • Start the Resource Monitor by selecting bada – Resource Monitor under Window > Show View > Other.. All rights reserved.. • You can monitor resource usage statistics to help you create efficient applications. Copyright © 2010 Samsung Electronics Co. Ltd. registry. 97 . Available monitoring features include: – Running applications in the Simulator or a target device. • You cannot monitor resource usage during target debugging. heap.

All rights reserved. –  Import and export to and from log files.Output • Start the Output view by selecting Window > Show View > Other… > bada > Output.     Copyright © 2010 Samsung Electronics Co. –  Scroll lock and clear. –  Filter: • Select log types. 98 . debug. and exception messages from AppLog(). AppLogDebug() and AppLogException(). –  Find and replace. • The Output view shows the log.. Ltd.

. Ltd.UI Builder Copyright © 2010 Samsung Electronics Co. All rights reserved. 99 .

Ltd. All rights reserved.Contents • WYSIWYG Design with UI Builder • UI Builder Toolbar • Using Forms – – – – – Form Properties Dragging and Dropping Controls Designing Landscape Forms Creating Form Classes for the Designed Forms Constructing Forms • • • • • Using Scroll Panels Using Pop-ups Using String Tables Setting Display Language Adding New Keyboard Languages Copyright © 2010 Samsung Electronics Co. 100 ..

Ltd. All rights reserved..dtd"> <Scene> <Form id="IDF_FORM1"> <property title="" headerHeight="0" … /> <layout mode="Portrait" style="FORM_STYLE_INDICATOR|…"/> <layout mode="Landscape" style="FORM_STYLE_NORMAL"/> </Form> <Button id="IDC_BUTTON1" parent="IDF_FORM1"> <property text="" hAlign="ALIGN_CENTER" vAlign="ALIGN_MIDDLE" normalBGColor="" normalTextColor="" pressedBGColor="" pressedTextColor="" disableBGColor="" disableTextColor=""/> <layout mode="Portrait" x="40" y="526" width="410" height="90"/> <layout mode="Landscape" x="66" y="352" width="683" height="54"/> </Button> </Scene> Save to XML Copyright © 2010 Samsung Electronics Co. 101 .0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE Scene SYSTEM "UIForm.WYSIWYG Design with UI Builder You can create compelling GUIs with WYSIWYG design tools. <?xml version="1.

UI Builder Toolbar In addition to regular keyboard and mouse control. – Toolbar:  Zoom  Editing mode: Portrait.. the form designer toolbar provides additional time-saving design tools. 102 . All rights reserved. Landscape  Align controls  Toggle grid  Toggle rulers      Copyright © 2010 Samsung Electronics Co. Ltd.

• Double-click the new form to open it in the editor. All rights reserved. • Adding forms to your application is easy:  Select a project in the Project Explorer.. Ltd.  Right-click to add a new form: • Select Insert Resource in the context menu.   Copyright © 2010 Samsung Electronics Co. 103 .Using Forms • Go to Window > Show View > Other… and select bada Resource Explorer if you do not see the Resource Explorer.

Form Properties
You can add an Indicator bar, Title bar, Soft key, and Option key to the form in the Properties tab.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

104

Dragging and Dropping Controls
Add in additional GUI controls by dragging and dropping them onto your application form and setting control properties:
 Select a control in the controls palette and drag and drop it onto the form.  Set the control‟s properties.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

105

Designing Landscape Forms
You can also create forms in landscape mode by selecting Landscape in the designer toolbar. This keeps the proper screen-size for your target device.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

106

107 ..Creating Form Classes for the Designed Forms (1/2) You can add new forms to your application by creating new classes: 1. Enter names for header and source files. Enter a class name Enter file names Copyright © 2010 Samsung Electronics Co. 2. All rights reserved. Ltd. Enter a class name for the form.

The ID must be unique within a form. Select event listeners. Ltd.. Enter an action ID when a specific event handler for each control is selected. 108 . Add event listeners for control Action ID is a specifier used in OnActionPerformed() Copyright © 2010 Samsung Electronics Co. All rights reserved.Creating Form Classes for the Designed Forms (2/2) You can add event listeners for controls in the created form class: 1. 2.

• You can construct the form and add it to the frame as shown in the following source code: – The name of the form class is Form1. – The source file is <class name>. All rights reserved. It is constructed in MyApp::Initialize(). pFrame->RequestRedraw(). pFrame->AddControl(*pForm1)..h. #include “Form1. … } Copyright © 2010 Samsung Electronics Co.h” MyApp::Initialize(…) { … Form1 *pForm1 = new Form1(). pFrame->SetCurrentForm(*pForm1).Constructing Forms • The files for the new form are shown in the Project Explorer. 109 .cpp and the header file is <class name>. Ltd. pForm1->Initialize().

Using Scroll Panels You can add scroll panels to forms and design the panels in the same way as forms:  Add the scroll panel to a form. 110 .  Double-click the scroll panel to open it in the designer.    Copyright © 2010 Samsung Electronics Co. All rights reserved. Ltd..  Design the scroll panel.

Using Pop-ups You can add and design pop-ups in the same way as forms:  Add the pop-up resource to the project..    Copyright © 2010 Samsung Electronics Co.  Design the pop-up.  Double-click the pop-up to open it in the designer. Ltd. All rights reserved. 111 .

 Add new languages.  Double-click the string table.Using String Tables (1/2) You can use string tables for easy resource management and localization.. Ltd. 112 .    Copyright © 2010 Samsung Electronics Co.  Add new strings. All rights reserved.

GetString()fails. r = pApp->GetAppResource()->GetString("IDS_STRING1"..Using String Tables (2/2) • Strings in string tables can be used in source code. Copyright © 2010 Samsung Electronics Co. . English is used. • To make the updated string tables active on the device. • If a string table does not exist for a language. 113 . .. Ltd. Application* pApp = Application::GetInstance(). String str1. go to Settings > General > Display language and select the corresponding language. All rights reserved.... str1). If the string table does not exist even for English.

Ltd. All rights reserved. Select the language to be used. 1. Go to Settings > General > Display language. 114 .. Copyright © 2010 Samsung Electronics Co.Setting Display Language You can define the display language under Settings. 2.

Go to Settings > General > Keyboard language.. Ltd.Adding New Keyboard Languages (1/3) You can add a new keyboard language under Settings. All rights reserved. 115 . Copyright © 2010 Samsung Electronics Co. 1.

Select the new languages. 116 .. Ltd. Copyright © 2010 Samsung Electronics Co. All rights reserved.Adding New Keyboard Languages (2/3) 2.

Adding New Keyboard Languages (3/3) After the new languages are added. Copyright © 2010 Samsung Electronics Co. Ltd. you can press the language button on the virtual keyboard to toggle the language selection. All rights reserved. 117 ..

Ltd. All rights reserved. 118 .bada Testing Tool Copyright © 2010 Samsung Electronics Co..

. All rights reserved. 119 . Ltd.Contents • Overview • Testing Applications – Creating a Test Project – Creating Test Cases – Running a Test Project • Collecting Test Coverage Data Copyright © 2010 Samsung Electronics Co.

you can modify the test cases to improve the software quality. • Based on the coverage data. – Code coverage tool • The tool calculates the percentage of application code that is covered by the test cases. • bada Testing Tool contains the following functionality: – Wizards • Make unit testing easier and faster. • Generate method stubs for methods in your application that you want to test. Ltd. • You can view the generated coverage data in the Coverage view. – bada testing framework • The testing framework provides an API that enables you to develop different types of test cases. For more information on the testing framework. Copyright © 2010 Samsung Electronics Co.. All rights reserved. • Configure a unit testing environment. 120 .Overview • The bada Testing Tool allows you to test your application on a unit level. see the bada Developer Guide.

Run the test project on the Simulator or a target device. Create the test cases with the Test Case Wizard. 3. Copyright © 2010 Samsung Electronics Co.. 121 . 2. Ltd.Testing Applications • The bada Testing Tool contains wizards that enable you to build an automated test framework and generate method stubs in a quick and easy manner. Create a test project with the Test Project Wizard. All rights reserved. • To test your application: 1.

right-click the application project that you want to test and select New > bada Test Project. All rights reserved..Creating a Test Project (1/3) To create a test project: 1. 122 . In the Project Explorer view. Ltd. Copyright © 2010 Samsung Electronics Co.

Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved. 123 . In the New Test Project window: • • Give a name and destination folder for the test project Select the Use check box and then select the existing bada project you want to test from the list of available reference projects. Click Finish. 3..Creating a Test Project (2/3) 2.

. Copyright © 2010 Samsung Electronics Co.xml file. 124 . • The test project also uses a copy of the application project‟s manifest. All rights reserved. Ltd. – The targetLink folder is automatically added to the build path in the test project properties along with the inc and src folders.Creating a Test Project (3/3) • The generated test project contains a targetLink folder that contains the files and resources of the target application project to be tested.

• To create a test case: 1. All rights reserved. Copyright © 2010 Samsung Electronics Co.cpp file in the application project that you want to test and select New > bada Test Case. 125 . you must create the required test cases and add them to the test project.Creating Test Cases (1/3) • After you have created the test project.. Ltd. Right-click a header file or .

Ltd..Creating Test Cases (2/3) 2. define the details for the test case: • Make sure that the target bada application project and the test project to which the new test case belongs are correct. • • Copyright © 2010 Samsung Electronics Co. Give a name for the test case. 126 . In the New bada Test Case window. All rights reserved. Select the method stubs that you want to create and the class methods that you want to test.

The auto-generated method stubs are empty and they do not have any code implementation. All rights reserved. Click Finish..Creating Test Cases (3/3) 3. • • The wizard updates the targetLink folder and generates method stubs. Implement the actual content of the test case. You must implement the test fixtures and method stubs selected for the test case to test the application code behavior. 4. Ltd. • Copyright © 2010 Samsung Electronics Co. These method stubs provide a default assertion that displays a “Not yet implemented” failure message. 127 .

right-click the test project and select Run As and then the appropriate testing environment: • The test results are displayed in the bada Test view.. All rights reserved. Ltd. 128 .Running a Test Project (1/2) • You can run your test project on the Simulator or a target device. • To run a test project. Copyright © 2010 Samsung Electronics Co.

Running a Test Project (2/2) You can use the following function buttons in the bada Test view: Move to the next failed test case Move to the previous failed test case Show failures only in the test result view Lock the bada Test view scroll bar Rerun all tests Rerun failed and erroneous test cases only Terminate the test execution Clear the test results Import the XML file that contains the test results Export the test results to an XML file Test cases executed with assertion failures Test cases successfully executed Test cases executed with exceptions Copyright © 2010 Samsung Electronics Co.. Ltd. All rights reserved. 129 .

. • The code coverage tool uses a wide variety of criteria to calculate the coverage. Copyright © 2010 Samsung Electronics Co. • The code coverage tool supports the Simulator only. 130 . Ltd. All rights reserved.Collecting Test Coverage Data (1/5) • You can use the code coverage tool to check how comprehensively your application has been tested. indicating the percentage of lines of code that is tested. It supports line coverage.

Close the Simulator.. Run your test project. All rights reserved. Ltd.Collecting Test Coverage Data (2/5) To be able to view the coverage data for your application during unit testing: 1. In the Project Explorer view. 4. right-click the application project under testing and select the coverage compilation option in Properties > bada Coverage. Click OK. 3. 2. Copyright © 2010 Samsung Electronics Co. 131 .

Copyright © 2010 Samsung Electronics Co. Click the Coverage button in the toolbar to run the code coverage tool and open the Coverage view.Collecting Test Coverage Data (3/5) 5. 132 . All rights reserved.. Ltd.

Collecting Test Coverage Data (4/5) • The lines of code covered in the test are highlighted in blue. All rights reserved. Ltd. 133 . and the lines of code that are not covered are highlighted in red. Copyright © 2010 Samsung Electronics Co. • You can view the calculated coverage data (percentage of covered and uncovered lines of code) in the Coverage view..

. All rights reserved. Clean coverage data Hide coverage lines in source files Show coverage data Export coverage data Import coverage data Copyright © 2010 Samsung Electronics Co. Ltd.Collecting Test Coverage Data (5/5) • You can manage the coverage data using the function buttons in the Coverage view. 134 .

. All rights reserved. Ltd.bada UI Sequencer Tool Copyright © 2010 Samsung Electronics Co. 135 .

Ltd. 136 ..Contents • • • • Overview User Events Recording and Playing User Events Event Editor – Adding and Editing Events • Comparing Images • Creating a UI Sequencer Project – Adding Test Suites and Test Cases – Playing Test Suites and Test Cases Copyright © 2010 Samsung Electronics Co. All rights reserved.

you can avoid having to repeat manually tedious and repetitive tasks. Ltd. in your application by recording those tasks and running them with the tool. like login processes. During development. Copyright © 2010 Samsung Electronics Co.Overview • The bada UI Sequencer tool is used to test the application UI by comparing the screens displayed in response to user events with screens that were previously recorded in response to the same user events. 137 . • The tool enables you to: – – – – Record user event sequences. Add and edit user events within existing recordings. you can perform regression and stress testing. and compare the images to the images captured when the recording was originally made. Capture UI screen images while playing a recording.. Play recordings. • With the tool. – Create a UI Sequencer project to manage a large number of recordings as test cases. All rights reserved.

All rights reserved. Event PRESS RELEASE LONG PRESS Notifies when a key is pressed. Notifies when an entity is touched twice quickly. • Every key has a unique key code associated with it.User Events The bada UI Sequencer tool supports 3 types of user events: – Touch events: • These events are generated in response to touch-related user actions. – Key events: • These events are generated in response to key press-related user actions. 138 . Ltd. see the bada Developer Guide. Description – Event Injector events: • These events are generated by the Event Injector of the Simulator. Event PRESS RELEASE Notifies when an entity is touched. Notifies when an entity is released. Notifies when a key is pressed and held for a long time. Notifies when an entity is touched and held for a long time. Notifies when a key is released. For more information. Copyright © 2010 Samsung Electronics Co.. Description MOVE – LONG PRESS DOUBLE PRESS Notifies when an entity is moved.

Capture: Capture the current screen. and the tool compares the current screen images to the recorded images.. Play: Play the recorded sequence. 139 . When running the application later on. Stop: Stop recording or playing. You can use the following function buttons on the IDE toolbar to record and play user events: • Record: Record a user event sequence. Copyright © 2010 Samsung Electronics Co. Ltd. Pause: Pause recording or playing. you can play the recorded user events.Recording and Playing User Events (1/3) • To test your application UI. All rights reserved. you must first record user events and capture screen images while running the application.

click Capture to capture the screen image. The new recording is saved as an XML file. 140 . Click Stop to stop recording.Recording and Playing User Events (2/3) To record user events: 1. Perform the user events which you want to record. Whenever the screen changes on the UI. 2.. 5. In case of the target device. Note that if you have an existing recording open in the Event Editor. you can add the newly recorded events at the end of the existing recording instead of creating a new one. and click Finish. Define the name and location for the new recording. Ltd. Click Record to start recording the user events. Run your application on the Simulator or a target device. Copyright © 2010 Samsung Electronics Co. use the Target-Release build configuration. and opens in the Event Editor. All rights reserved. The Record button is activated after the application has been loaded to the Simulator or device. 3. 4.

Ltd. Click Play to replay the recorded sequence of user events. 3. Run your application on the Simulator or a target device. 2.. The Play button is activated after the application has been loaded to the Simulator or device.Recording and Playing User Events (3/3) To play a recording: 1. Open the recording in the Event Editor. 4. In case of the target device. 141 . set the repeat count in the PLAY Repeat field in the Event Editor. Copyright © 2010 Samsung Electronics Co. To define the number of times the recording must be played. use the Target-Release build configuration. All rights reserved.

All rights reserved. Ltd. 142 . Copyright © 2010 Samsung Electronics Co..Event Editor (1/2) The Event Editor enables you to add or edit the user events in the recordings.

Event Editor (2/2)
The Event Editor contains the following settings:
– Time interval:
• Defines the unit of gradation in the time line. You can set an interval of 1 or 10 seconds, 1 or 10 minutes, or 1 hour.

– PLAY Repeat:
• Defines the number of times a recording is replayed.

– Current PLAY Count:
• Displays the current play count and is incremented by 1 each time recording is replayed.

– Event List:
• Contains a list of recorded user events. Select an event from the list to view the event properties. The event bar of the time line is synchronized to match the selected event‟s properties.

– Event Properties:
• Displays the event properties, such as event type and position. You can also set the time delay that must be held between two successive events.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

143

Adding and Editing Events
• To add an event to a recording:
1. In the Event Editor, select the event after which the new event must be added. You can click Up or Down to reorder the event list. 2. In the Properties panel, select New and set the event properties. The available properties depend on the event type. 3. Click Add. 4. To save the recording, select File > Save in the IDE menu.

• To edit an existing event:
1. 2. 3. 4. In the Event Editor, select the event that you want to edit. In the Properties panel, edit the event properties. Click Apply. To save the recording, select File > Save in the IDE menu.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

144

Comparing Images (1/4)
• You can capture screen images while recording user events. To capture screen images, click Capture on the IDE toolbar. • When you play the recording, screen images are captured at the same points between user events, and the new images are compared to the original recorded images. The test results define any images where the original and new images differ. • The bada UI Sequencer tool supports 2 types of image comparisons:
– Full comparison compares the entire UI screen. – Partial comparison allows you to define an area of the screen, and compares only the defined area. The partial comparison can be useful, for example, if your UI screens contain the indicator area showing the current time. To avoid all image comparisons to be marked as failed just because the time of replaying the event sequence differs from the time when you recorded it, you can exclude the indicator area from the comparison.

Copyright © 2010 Samsung Electronics Co., Ltd. All rights reserved.

145

The images are displayed in a pop-up window side by side for easy visual comparison. The images which fail the comparison are displayed in the Event Editor in red. 146 . A B Copyright © 2010 Samsung Electronics Co.. All rights reserved. Select a failed event (A). click Compare (B). Under Event Properties.Comparing Images (2/4) To compare full images: 1. Ltd. Play a recording. 3. 2.

In the Event Editor. The selected area is highlighted in green color. 147 . click Compare (A). click Select an area (A).Comparing Images (3/4) To compare partial images: 1. and click Ok (B). 2. Play the recording. Drag and select the area of the image that you want to compare. 5. 6.. All rights reserved. Select a failed event. select an image from the Event List. Ltd. The images whose selected area fails the comparison are displayed in the Event Editor in red. 4. Under Event Properties. A B Copyright © 2010 Samsung Electronics Co. 3. The images are displayed in a pop-up window side by side for easy visual comparison. Under Event Properties.

. Copyright © 2010 Samsung Electronics Co. Ltd. 148 . All rights reserved.Comparing Images (4/4) • The comparison result is displayed in a pop-up window: • You can zoom in or out in the images for better comparison.

• To create a UI sequencer project: 1. 3. you can create a bada UI Sequencer project in the IDE and store all your test cases in it. you can create test suites within the project and gather related test cases into a test suite. Ltd. Copyright © 2010 Samsung Electronics Co.. go to File > New > bada UI Sequencer Project. enter a name and destination folder for the project. In the New bada UI Sequencer Project window. All rights reserved. • To manage and run test cases easily. 2. In the IDE. • Each test cases contain one recorded user event sequence.Creating a UI Sequencer Project • To manage a large number of test case files easily. Click Finish. 149 .

3. In the IDE menu. double-click the manifest. Ltd. In the bada UI Sequencer Editor. • To delete a test suite or a test case. • To add a test suite or a test case: 1. select File > Save. select the event from the event list and click Remove. you can add the required test suites and test cases using the project manifest file. you must select the test suite under Events before clicking Add Test. 2.mf file to open it in the editor mode or right-click the file and open it with the bada UI Sequencer Editor. Note that to add a test case to a specific test suite. 150 . All rights reserved. Copyright © 2010 Samsung Electronics Co. do one of the following: • • Click Add Group to add a test suite and define its properties.Adding Test Suites and Test Cases • After you have created a project. Click Add Test to add a test case and define its properties.. In the Project Explorer.

Run your application on the Simulator or a target device. 2.mf file. Copyright © 2010 Samsung Electronics Co.Playing Test Suites and Test Cases • When your test cases are stored in a bada UI Sequencer project. 4. All rights reserved. 151 . • To play the entire test suite or a single test case: 1. 3. Open the bada UI Sequencer project„s manifest. you can play all the test cases included in a test suite at one go.. Ltd. Click Play. Select the test case or suite you want to play.

.FAQ Copyright © 2010 Samsung Electronics Co. All rights reserved. 152 . Ltd.

Copy the source and resource files to the created bada project folder to the appropriate subfolders (source files to /src. 2.. and resource files to /Res). Set the compilation flags: • Include paths in: Project Properties > C/C++ General > Paths and Symbols Copyright © 2010 Samsung Electronics Co. 3.FAQ (1/8) How do I convert Visual Studio projects into bada application projects? 1. 153 . All rights reserved. Create a new bada application project with bada IDE. Ltd. include files to /inc.

All rights reserved. 154 . Ltd.. Define linker options in: Project Properties > C/C++ Build > Settings > bada C++ Linker Library name Library path Copyright © 2010 Samsung Electronics Co.FAQ (2/8) 4.

ini configuration file in the bada IDE folder: • Xms40m → Xms256m • Xmx256m → Xmx1024m • How do I cope with the occurrence of java.FAQ (3/8) • How do I improve the execution performance of the bada IDE? – You can tweak the memory size to fit your development machine. – Change the badaIDE. All rights reserved. Fix the error by appending the following to the badaIDE. 155 .lang. Ltd..ini configuration file in the bada IDE folder: • XX:PermSize=64m • XX:MaxPermSize=128m Copyright © 2010 Samsung Electronics Co.OutOfMemoryError: PermGen space errors in the bada IDE? – PermGen means the permanent generation of objects in the VM.

click the Terminate button in the Console or Debug view to terminate the run or debug process. Ltd.FAQ (4/8) • How do I cope with the occurrence of the build error “cs-make: *** [src/source. Copyright © 2010 Samsung Electronics Co. • How do I cope with errors that occur when running or debugging an application on the target device? – In the bada IDE.. – Rebuild the application when you encounter this error. All rights reserved. which means that the compiler has run out of memory. 156 .o] Error -1073741819”? – The error code 1073741819 indicates an “Error Access Violation”.

FAQ (5/8) How do I cope with a situation in which the declaration cannot be found or is found in the wrong include files when executing the “open declaration” command? This problem occurs when I execute the command after modifying the bada SDK root or after importing a bada Application project. 157 . – Right-click the project and select Index > Rebuild.. Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved.

such as the one shown below. 2.. • If you have not installed JRE or JDK.FAQ (6/8) How do I cope with errors. move the jre directory from <BADA_SDK_HOME>\IDE to <BADA_SDK_HOME>. All rights reserved. that occur when updating the bada IDE? 1. Ltd. Do one of the following: • If you have already installed JRE or JDK. 158 . remove the <BADA_SDK_HOME> \IDE\jre directory. Add <BADA_SDK_HOME>\jre\bin to the PATH environment variable. 3. Copyright © 2010 Samsung Electronics Co. Exit the bada IDE. Start the bada IDE.

All rights reserved. If an update for the bada IDE is found.FAQ (7/8) 4. In the bada IDE menu. Ltd. move it back to <BADA_SDK_HOME>\IDE. 5. Remove <BADA_SDK_HOME>\jre\bin from the PATH environment variable. 6. go to Help > Check for Updates.. select it and click Next to continue and complete the installation process. 159 . Copyright © 2010 Samsung Electronics Co. If you moved the jre directory from <BADA_SDK_HOME>\IDE to <BADA_SDK_HOME> before installing the updates.

Run fosp_update. 2. Copy fosp_update. 4. 160 . Exit the bada IDE. Start the bada IDE and rebuild the project.FAQ (8/8) How do I cope with errors. Copyright © 2010 Samsung Electronics Co. Ltd.. All rights reserved. that occur when building a bada project? 1.exe in the project root directory. such as the one shown below.exe from <BADA_SDK_HOME>\IDE\ to the root directory of the project. 3.

Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved. 161 ..

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.