Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Contents

Contents About this Publication Acknowledgments Preface Introduction Overview of the Book What bada Is and Isnt
Just the Facts

vii xvii xix xxi 1 1 2


3

Part I Chapter 1

About bada The Mobile Difference 1.1 The Mobile Context 1.2 Characteristics of Mobile Software
1.2.1 1.2.2 1.2.3 Technological Differences Differences Related to Usability and User Experiences Differences in the Ecosystem

7 9 9 11
11 12 13

1.3 Chapter 2

Mobile App Development Best-Practices


What You Will Learn What You Will Need

14 19
19 20

bada Basics

2.1

Your First bada Application


2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 A Skeleton App Project Structure App Metadata Build and Run Standard Output

20
21 23 24 25 28

vii

viii

Contents 2.2 The Application UI


2.2.1 2.2.2 2.2.3 2.2.4 Frames, Forms, and Controls Standard Elements of a Form Indicator Bar, Title Bar, Soft Keys, Option Menu Handling Events Summary A Simple UI Form Properties The Buddy List

29
30 31 32 33

2.3

UI Builder
2.3.1 2.3.2 2.3.3

33
33 35 38

2.4 2.5 2.6

Hooking Up Your Forms to Your Code The App Icon Becoming Multilingual in Three Easy Steps
2.6.1 2.6.2 2.6.3 Add New Languages Add Text for Each Language Use String Resource IDs in Your Code

41 46 47
48 49 50

2.7 Chapter 3

From Idea to Published App


What You Will Learn What You Will Need

50 63
63 63

Beyond the Basics

3.1

Expanding the Application Skeleton


3.1.1 3.1.2 3.1.3 Being Event Driven The Runtime App Lifecycle A Note about Frameworks Control Hierarchy More about UI Controls More about Frame More about Form More about Canvas Graphics Primitives Bitmaps and Images Colours Adding an OptionMenu Adding a Soft Key Populating a List

64
65 65 69

3.2

Using the UI Framework


3.2.1 3.2.2 3.2.3 3.2.4

70
70 71 75 77

3.3

Using Graphics
3.3.1 3.3.2 3.3.3 3.3.4

78
79 80 83 88

3.4

The BuddyFix UI Revisited


3.4.1 3.4.2 3.4.3

89
90 93 94

Chapter 4

bada Fundamentals
What You Will Learn What You Will Need

97
97 97

4.1

Architecture Overview
4.1.1 4.1.2 4.1.3 bada Features A Short bada History The Layered Model of the bada Platform

98
98 99 101

Contents 4.2 bada Coding Idioms


4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 C++ and bada The Native System Alternatives to Native C++ Pitfalls Native Idioms and Types Tutorials Native Types Using Strings, Characters, and Unicode Using Buffers Collection Classes Using Dates and Times Using Numbers Privileges in bada In Practice

ix

103
103 104 104 104 106

4.3

bada Basic Functionality


4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6

117
117 118 121 121 124 124

4.4

Security and the Privilege Model in bada


4.4.1 4.4.2

125
126 127

Chapter 5

Exploring bada Services


What You Will Learn What You Will Need

129
129 129

5.1

What are the Services?


5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 Location Service Social Service Content Service Commerce Service Single Sign On Device-to-Server Interaction bada APIs bada Server and Third-Party Server Interaction with Open APIs Location as a Service Social Network Service All Connected Content Service Content is King Commerce Service Make Your Own Business Component Setup

130
130 130 131 132 132

5.2

How It Works
5.2.1 5.2.2

132
132 133

5.3

Services in Detail
5.3.1 5.3.2 5.3.3 5.3.4 5.3.5

135
135 140 147 150 153

Chapter 6

bada Namespaces
What You Will Learn What You Will Need

157
157 158

6.1 6.2 6.3

using Directives and Declarations How This Chapter Is Organised Namespaces in Detail

158 159 160

Contents Part II Group 1 Recipes Fundamentals Recipe 1.1: Save to and Restore from the Registry
Problem Description The Recipe Hints, Pitfalls and Related Topics

211 213 213


213 213 216

Recipe 1.2: Use Error Handling in bada


Problem Description The Recipe

217
217 217

Recipe 1.3: Use Two-phase Construction and Leak-free Destruction


Problem Description The Recipe Hints, Pitfalls, and Related Topics

224
224 224 228

Recipe 1.4: Create an AppControl to Interact with a Base Application


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

228
228 228 235 236

Recipe 1.5: Create and Use a Timer


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

236
236 236 239 239

Recipe 1.6: Parse XML Content


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

239
239 239 243 243

Recipe 1.7: Get Dates and Times


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

243
243 243 250 250

Group 2

UI Basics Recipe 2.1: Add a Form to a Frame-based App


Problem Description The Recipe Hints, Pitfalls, and Related Topics

251 251
251 251 255

Recipe 2.2: Add Soft Keys to a Form and Get Actions


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

255
255 255 258 258

Contents Recipe 2.3: Add an Options Menu to a Form and Get User Selections
Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

xi

258
258 258 263 263

Recipe 2.4: Add a Simple Button Control to a Form


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

263
263 264 268 269

Recipe 2.5: Pop Up a Message Box with Dismiss


Problem Description The Recipe Hints, Pitfalls, and Related Topics

269
269 269 270

Recipe 2.6: Pop Up a Keypad and Get Input from It


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

272
272 272 279 279

Recipe 2.7: Get Touch Events


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

280
280 280 285 286

Recipe 2.8: Get Multi-touch Events


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

286
286 286 290 290

Recipe 2.9: Create a Custom List Control


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

291
291 291 298 298

Recipe 2.10: Implement a Form Manager


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

298
298 298 309 309

Recipe 2.11: Get Soft Key and Hard Key Events


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

309
309 309 312 313

xii

Contents Recipe 2.12: Use a Web Control


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

313
313 313 319 319

Group 3

Extended UI and Sensors Recipe 3.1: Use Gesture Input and Motion UI
Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

321 321
321 321 326 327

Recipe 3.2: Get Device Orientation from the Magnetometer (Compass)


Problem Description The Recipe Hints, Pitfalls, and Related Topics

327
327 327 331

Recipe 3.3: Get Readings from the Tilt Sensor


Problem Description The Recipe Hints, Pitfalls, and Related Topics

332
332 332 336

Recipe 3.4: Detect a Face from Video


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

337
337 337 341 342

Recipe 3.5: Recognise a Face


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

342
342 342 346 346

Group 4

Multimedia Content Recipe 4.1: Use Bitmaps and Images


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

347 347
347 347 351 351

Recipe 4.2: Draw Graphics Primitives


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

352
352 352 356 356

Recipe 4.3: Open the Camera and Get and Display Live Frames
Problem Description The Recipe

356
356 356

Contents
Hints, Pitfalls, and Related Topics Related Recipes 360 360

xiii

Recipe 4.4: Use an Overlay Panel


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

360
360 361 365 366

Recipe 4.5: Record Audio from the Microphone or Audio Input Device
Problem Description The Recipe Hints, Pitfalls, and Related Topics

366
366 366 369

Recipe 4.6: Play a Sound


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

369
369 370 373 374

Group 5

Networking Recipe 5.1: Create a Network Connection


Problem Description The Recipe

375 375
375 375

Recipe 5.2: Use Secure Sockets


Problem Description The Recipe Hints, Pitfalls, and Related Topics

379
379 379 383

Recipe 5.3: Establish Normal and Pipeline Connection Modes for HTTP Sessions
Problem Description The Recipe Hints, Pitfalls, and Related Topics

383
383 383 387

Recipe 5.4: Use Bluetooth Profiles


Problem Description The Recipe

388
388 388

Recipe 5.5: Use Non-blocking and Blocking TCP and UDP Sockets
Problem Description The Recipe Hints, Pitfalls, and Related Topics

395
395 395 401

Recipe 5.6: Set Up an Ad Hoc Wi-Fi Network


Problem Description The Recipe Hints, Pitfalls, and Related Topics

401
401 401 406

Recipe 5.7: Query a DNS Server


Problem Description The Recipe

406
406 406

xiv

Contents Group 6 Maps and Location 6.1 Get Geographic Data from a Provider and Show a Map
Problem Description The Recipe Hints, Pitfalls, and Related Topics

411 411
411 411 413

6.2 React to Location Changes


Problem Description The Recipe Hints, Pitfalls, and Related Topics

414
414 414 415

Group 7

Services and Social Networking 7.1 Create Content on the bada Server
Problem Description The Recipe Hints, Pitfalls, and Related Topics

417 417
417 417 421

7.2 Use the bada SNS Gateway to Access a Social Network Service such as Facebook
Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

422
422 422 429 430

7.3 Send a Tweet from Twitter


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipe

430
430 430 434 434

7.4 Upload a Photo to Facebook


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

434
434 434 438 438

7.5 Get Notes from Facebook using RESTful APIs


Problem Description The Recipe Hints, Pitfalls, and Related Topics Related Recipes

439
439 439 446 446

7.6 Use the BuddyService to Add a Buddy


Problem Description The Recipe Hints, Pitfalls, and Related Topics

446
446 447 450

Contents Part III Appendices 451 453 459 459 460 463 464 465
465 466 466 466

xv

Appendix A Downloading and Installing the bada SDK Appendix B A UML Primer B.1 Class Diagrams B.2 Sequence Diagrams Appendix C A Software Engineering Model for Mobile App Development Some Mobile Software Engineering Best-practices Phase 1: Feasibility and Economic Efficiency Analysis
Stage 1.1: Requirements Engineering Stage 1.2: Design Drafting Stage 1.3: Early Prototyping Stage 1.4: User Acceptance Testing

Phase 2: Software Product Realisation


Stage 2.1: Requirements Reviewing Stage 2.2: Design Detailing Stage 2.3: Defining Test Cases Stage 2.4: Programming Stage 2.5: Testing Stage 2.6: User Acceptance Testing

467
467 467 467 468 468 468

Phase 3: Distribution
Stage 3.1: Marketing Stage 3.2: Preparing for Deployment Stage 3.3: Product Maintainance

469
469 469 469

Index

471

You might also like