You are on page 1of 56

How to make your first bada application

Copyright Copyright© ©2010 2010Samsung SamsungElectronics ElectronicsCo., Co.,Ltd. Ltd.All Allrights rightsreserved. reserved.

Contents
Exploring the bada developer site Making your first bada application Making your own bada application

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

2

Exploring developer.bada.com

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

3

Exploring developer.bada.com

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

4

Exploring developer.bada.com

Beginning with the Developer Site

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

5

6 . Ltd..Beginning with developer site View various technical documentation Click ‘Resources’ Copyright © 2010 Samsung Electronics Co. All rights reserved.

All rights reserved. Ltd..Beginning with developer site Download latest bada SDK/IDE Click ‘Development Tools’ Copyright © 2010 Samsung Electronics Co. 7 .

bada SDK Consists of: – Platform binaries and libraries – Header files – Simulator – GNU tool chain – Documents – Sample applications Copyright © 2010 Samsung Electronics Co. All rights reserved. 8 .. Ltd.

. All rights reserved. 9 .bada IDE Eclipse CDT-based (C/C++ Development Tools) Additional plug-ins: – File Explorer – Resource Monitor – Application Wizard – Output – UI Builder – Resource Explorer Copyright © 2010 Samsung Electronics Co. Ltd.

Ltd.bada IDE Project Explorer Text Editor Outline Output/File Explorer/Resource Monitor… Copyright © 2010 Samsung Electronics Co. 10 .. All rights reserved.

11 . Ltd..UI Builder Controls Design area Resource Explorer Properties Copyright © 2010 Samsung Electronics Co. All rights reserved.

UI Builder tool basics <?xml version="1.. 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> Design Area Controls Resource Explorer Properties Generate XML Copyright © 2010 Samsung Electronics Co. Ltd. 12 .0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE Scene SYSTEM "UIForm.

13 .. Ltd.Making your first bada application The "Hello bada" application Copyright © 2010 Samsung Electronics Co. All rights reserved.

. 14 .UI structure Frame Indicator Title The top level window There is one per application Control(s) Controls are added to Forms Softkey Form(s) High level container There can be multiple Forms Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved.

Ltd. All rights reserved..Looking at the Hello bada app ‘Hello bada!’ is here If ‘OK’ button is pressed. ‘OK …clicked!’ is printed in output window Copyright © 2010 Samsung Electronics Co. 15 .

Creating a new application Create a new project: File New bada Application Project Create a new bada form based application: 1. Click ‘Next >’ or ‘Finish’ Copyright © 2010 Samsung Electronics Co. Ltd. 16 . Select your project type 3. All rights reserved. Write your project name 2..

All rights reserved.. 17 .Hello bada application project helloBada Project Copyright © 2010 Samsung Electronics Co. Ltd.

Building and running the project Set build configuration to Simulator-Debug: Build Configurations Set Active 1 Simulator-Debug Copyright © 2010 Samsung Electronics Co.. Ltd. All rights reserved. 18 .

19 .Building and running the project Set build configuration to Simulator-Debug: Build project: Build Project Copyright © 2010 Samsung Electronics Co. All rights reserved.. Ltd.

20 .. All rights reserved.Building and running the project Set build configuration to Simulator-Debug: Build project: Run in simulator: Run As 1 bada Simulator Application Copyright © 2010 Samsung Electronics Co. Ltd.

step out. All rights reserved.. 21 . step over breakpoints.Debugging the project Run in debug mode in simulator: – sdf Debug As 1 bada Simulator Application Debugging with GDB Set breakpoints. Ltd. step in. and watch variables Copyright © 2010 Samsung Electronics Co.

Simulator Testing Testing with Event Injector Target Testing Packaging Artificial Events bada Simulator Event Injector Copyright © 2010 Samsung Electronics Co. All rights reserved. Ltd.. 22 .

Ltd. All rights reserved..Simulator Testing Testing on target device Connect target to PC through USB Install device driver for target Target Testing Packaging USB cable * Target device testing is supported from bada SDK 1. 23 .0 Copyright © 2010 Samsung Electronics Co.

All rights reserved. .. Ltd.Simulator Testing Testing on target device In bada IDE: Target Testing Packaging – Change Build Configurations and build project: Build Configurations Set Active 2 Target-Debug – Run the application on the target device: Run As 2 bada Target Application 24 Copyright © 2010 Samsung Electronics Co.

Demo [making the helloBada application] Demo Sequence: – Create a new bada application project – Build – Run in bada simulator Copyright © 2010 Samsung Electronics Co. 25 . Ltd. All rights reserved..

Simulator Testing Packaging the project Make package in bada IDE: Target Testing Packaging Project Make Package Copyright © 2010 Samsung Electronics Co.. 26 . All rights reserved. Ltd.

.zip) application. Binaries App. 27 .xml manifest. Ltd.com GO! Package ([app].Simulator Testing Packaging the project Make package in bada IDE Uploading your package for certification: Developer Target Testing Packaging http://seller.xml App. Resources Register Result Copyright © 2010 Samsung Electronics Co. All rights reserved.samsungapps.

Ltd. 28 ..bada SDK Consists of: – Platform binaries and libraries – Header files – Simulator – GNU tool chain – Documents – Sample applications Copyright © 2010 Samsung Electronics Co. All rights reserved.

Importing bada samples Window Show View Other…: Copyright © 2010 Samsung Electronics Co.. All rights reserved. 29 . Ltd.

.Importing bada samples Window Show View Show View bada Other…: bada SDK Samples: Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved. 30 .

All rights reserved.Importing bada samples Window Show View Show View bada Other…: bada SDK Samples: select a sample bada SDK Samples Copy into my workspace…: Copyright © 2010 Samsung Electronics Co. Ltd.. 31 .

32 ..Importing bada samples Window Show View Show View bada Other…: bada SDK Samples: select a sample bada SDK Samples Copy into my workspace…: Selected sample is in Project Explorer: Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved.

33 . Ltd.. All rights reserved.Making your own bada application The "MyPlaces" application Copyright © 2010 Samsung Electronics Co.

Ltd. 34 . All rights reserved.MyPlaces Copyright © 2010 Samsung Electronics Co..

.Considerations Generate your application profile Set the generated ‘manifest. All rights reserved. Ltd. 35 .xml’ Set icon and loading screen for your application Copyright © 2010 Samsung Electronics Co.

All rights reserved.Generating an app profile (1/2) What is the purpose? To get application ID and set privileges & system requirement Generate your own application profile: 1. Ltd.Generate App Profile Copyright © 2010 Samsung Electronics Co.. Application Manager 3. My Application 2. 36 .

37 . All rights reserved. Click ‘Next >’ button Copyright © 2010 Samsung Electronics Co.Generating an app profile (2/2) Create App Profile Select Setup Privileged API Components Setup System Download Requirements Manifest. Ltd.xml MyPlaces 1. Enter your application name 2..

All rights reserved.Generating an app profile (2/2) Create App Profile Select Setup Privileged API Components Setup System Download Download Requirements Manifest. Ltd.xml * Privileged API Group Check what your application uses [Privileges are updatable] Copyright © 2010 Samsung Electronics Co.. 38 .xml Manifest.

xml Configure components related to bada server Copyright © 2010 Samsung Electronics Co.Generating an app profile (2/2) Create App Profile Select Setup Privileged API Components Setup System Download Download Requirements Manifest. 39 . All rights reserved.xml Manifest. Ltd..

.xml Manifest. screen size and so on] Copyright © 2010 Samsung Electronics Co. All rights reserved.Generating an app profile (2/2) Create App Profile Select Setup Privileged API Components Setup System Download Download Requirements Manifest. 40 . Ltd. network.xml Select system requirements of your application [CPU. memory.

41 ..xml Click the ‘Download’ button Copyright © 2010 Samsung Electronics Co. Ltd. All rights reserved.xml Manifest.Generating an app profile (2/2) Create App Profile Select Setup Privileged API Components Setup System Download Download Requirements Manifest.

.xml file into root directory of your project and overwrite it. 42 . Overwrite manifest. All rights reserved. Ltd.xml file in project root directory Copyright © 2010 Samsung Electronics Co.Applying the ‘manifest.xml’ (1/2) During application profile generation or updates Copy manifest.

Find downloaded ‘manifest.xml 1. Don’t check ‘Default manifest file’ 2. 43 .xml’ Copyright © 2010 Samsung Electronics Co.Setting the ‘manifest.xml’ (2/2) During initial bada application project creation: c:\bada\IDE\workspace\MyPlaces\manifest. Ltd.. All rights reserved.

Icons and loading screens Icon Loading screen Copyright © 2010 Samsung Electronics Co.. 44 . All rights reserved. Ltd.

. Ltd. 45 .Setting icons and loading screens Select your application project Select Properties Select Application Information Set your icon in MainMenu Set your loading screen in LanchImage Copyright © 2010 Samsung Electronics Co. All rights reserved.

All rights reserved. Ltd.Summary Copyright © 2010 Samsung Electronics Co. 46 ..

All rights reserved. Ltd. and debug bada applications How to import sample applications How to generate your application profile How to set icons and loading screens Copyright © 2010 Samsung Electronics Co..What we have learned How to handle bada SDK and IDE How to build. run. 47 .

.Find out more Tutorial – bada Tutorial. 48 .pdf Developer guide – Getting Started Copyright © 2010 Samsung Electronics Co.SDK. Ltd. All rights reserved.

Ltd. All rights reserved.goprodiver.com .. 49 http://www.Let’s diving into Dive into Copyright © 2010 Samsung Electronics Co.

50 . Ltd. privileges and system requirement] <?xml version="1.Manifest.. All rights reserved.0.xml that describes all aspects of your project [app ID.0</Version> <Privileges> <Privilege> <Name>LIFELOG</Name> </Privilege> <Privilege> <Name>WIFI</Name> </Privilege> Privileges </Privileges> <DeviceProfile> <CPU>ARM9</CPU> <InputDevice>Touch</InputDevice> <MinimumHeapSize>16</MinimumHeapSize> <MinimumVRAMSize>4</MinimumVRAMSize> <ScreenSize>480x800</ScreenSize> Device <SoundMixing>Enable</SoundMixing> Profile </DeviceProfile> </Manifest> Copyright © 2010 Samsung Electronics Co.0" ?> <Manifest> <Id>487h9r06q7</Id> Basic <Secret> F0D21DA292B7BF665B5830DDB5886150</Secret> Info <Version>1.

. 51 .Privileges Level Where you can find privileges – API Reference – Updating privileges are available Privilege level Level None don’t need any privilege Description Normal used by any developers who are bada developer members System used by developers who have a special partnership with Samsung Copyright © 2010 Samsung Electronics Co. All rights reserved. Ltd.

Ltd.. 52 . All rights reserved.Making your Application multilingual Copyright © 2010 Samsung Electronics Co.

All rights reserved. Double-click strings 2. 1. 53 .String resource localization You can add new language support through the UI Builder. Ltd.. Add or Remove languages Copyright © 2010 Samsung Electronics Co.

Language independent string IDs String Tables String Copyright © 2010 Samsung Electronics Co. 54 . Ltd.. All rights reserved.

Copyright © 2010 Samsung Electronics Co. Ltd. String str1. str1). Application* pApp= Application::GetInstance(). All rights reserved.. You can also set string IDs in code. 55 . r = pApp->GetAppResource()->GetString("IDS_STRING1".Read string ID content You can set string IDs through the UI Builder.

All rights reserved..Demo [Multiple Language Application] Demo equence: – Show string table – Run application in simulator • English text in UI controls – Set language to French – Run application in simulator • French text in UI controls Copyright © 2010 Samsung Electronics Co. 56 . Ltd.