Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers...

72
Entering Tizen world for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist

Transcript of Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers...

Page 1: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Entering Tizen world for iOS & Android

developers

Cheng Luo, DukSu Han Samsung Platform Evangelist

Page 2: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

2

Contents

1.  Platform Overview 2.  Frameworks 3.  Native UI 4.  Application Life Cycle 5.  Event Handling

Page 3: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

1. Platform Overview

Page 4: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

4

Native

Objective C C++����������� ������������������  

Tizen Android

Java / C++����������� ������������������  

iOS

Page 5: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

5

IDEs

Tizen Android iOS

Page 6: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

6

Target Device

Tizen Android iOS

Page 7: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

2. Frameworks

Page 8: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

8

Frameworks of Tizen

Page 9: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

9

Frameworks of Tizen

Page 10: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

10

Frameworks of Tizen

Page 11: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

iOS  to  Tizen

Page 12: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

12

Framework of iOS

Cocoa touch

Media

•  Accelerate Framework

•  Core Bluetooth Framework

•  External Accessory Framework

•  Generic Security Service

Framework

•  Security Framework

•  System

Core services

Core OS

iOS

Page 13: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

13

Framework of Tizen

Cocoa touch

Media

Core services

Core OS

Tizen

•  Tizen::Uix::Sensor

•  Tizen::Net::Bluetooth

•  Tizen::System::DeviceManager

•  Tizen::Security

•  Tizen::Base

Page 14: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

14

Framework of iOS

Cocoa touch

Media

Core OS

Core services

•  Accounts Framework

•  Address Book Framework

•  Ad Support Framework

•  CFNetwork Framework

•  Core Data Framework

•  Core Foundation Framework

•  Core Location Framework

•  Core Media Framework

•  Core Motion Framework

•  Core Telephony Framework

•  Event Kit Framework

•  Foundation Framework

•  Mobile Core Services Framework

•  Newsstand Kit Framework

•  Pass Kit Framework (iOS 6)

•  Quick Look Framework

•  Social Framework (iOS 6)

•  Store Kit Framework

•  System Configuration Framework

iOS

Page 15: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

15

Framework of Tizen

Cocoa touch

Media

Core OS

Core services

Tizen

•  Tizen::Social::Addressbook

•  Tizen::Net

•  Tizen::Base

•  Tizen::IO

•  Tizen::Location

•  Tizen::Media

•  Tizen::Telephony

•  Tizen::System::SystemInfo

Page 16: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

16

Framework of iOS

Cocoa touch

Core services

Core OS

Media

•  Assets Library Framework

•  AV Foundation Framework

•  Core Audio

•  Core Graphic Framework

•  Core Image Framework

•  Core MIDI Framework

•  Core Text Framework

•  Core I/O Framework

•  GLKit Framework

•  Media Player

•  OpenAL, OpenGL ES

•  Quartz Core Framework

iOS

Page 17: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

17

Framework of Tizen

Cocoa touch

Core services

Core OS

Media

•  Tizen::Media

•  Tizen::Graphics

•  Tizen::Io

•  Tizen::Text

•  OpenGL ES

•  OpenAL

Tizen

Page 18: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

18

Framework of iOS

Core services

Media

Core OS

Cocoa touch •  Address Book UI Framework

•  Event Kit UI Framework

•  Game Kit Framework

•  iAd Framework

•  Map Kit Framework

•  Message UI Framework

•  Twitter Framework

•  UIKit Framework

iOS

Page 19: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

19

Framework of Tizen

Core services

Media

Core OS

Cocoa touch •  Tizen::App::AppControl

•  Tizen::UI

Tizen

Page 20: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Android  to  Tizen

Page 21: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

21 Copyright © 2012 Samsung Electronics, Co., Ltd. All rights reserved. 21 Copyright © 2012 Samsung Electronics, Co., Ltd. All rights reserved. 21

Application Framework

Android Tizen

Activity UI application UI application Service Content Provider

Non-UI application

Service Application App::SqlDataControlProvider

App::MapDataControlProvider App Widgets Home Screen

Widget Shell::AppWidgetProvider

Preference Intent(Call Action) Binder(IPC)

App AppRegistry AppControl

MessagePort(IAC)

Android api17 vs. Tizen2.1

Page 22: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

22

Base

Android(android.) Tizen(Tizen::) java.lang collection

Base Collection

Base, Text Base::Collection

Collection::stlConverter(STL) util(regexp,zip) util(locale,timezone)

Utility Base::Utility, Base::Locales

util.concurrent(lock, semaphore) os (system info.) hardware.input

Thread System

Base::Runtime System(system info.,external device

)

IO Database

IO IO IO::Database

Page 23: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

23

Graphics & Multimedia

Android(android.) Tizen(Tizen::) Graphics (Canvas) Opengl (1.1, 2.0)

Graphics

Graphics (Canvas) Graphics::Opengl (1.1,2.0)

Media.mediaplayer - Audio, Video - Streaming hardware.camera media:Facedetector

Multimedia Media::Player - Audio, Video - Streaming: http,rtsp Media::Camera Uix::Vision(Facedetector, Image Recognizer, QR code)

Page 24: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

24

Communication

Android(android.) Tizen(Tizen::) net bluetooth net.http Java.socket net.wifi nfc telephony Notification

Communication Net Net::Bluetooth Net::Http Net::Sockets Net::Wifi Net::Nfc Telephony Messaging(sms,mms,email,push receive)

Page 25: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

25

Web & Contents

Android(android.) Tizen(Tizen::) Webkit Webkit.webview org.json org.xml, javax.xml

Web

Web Web::Controls Web::Json Libxml2

Page 26: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

26

User Interface

Android(android.) Tizen(Tizen::) View view.animation View.widget view.inputmethodservice Activity, Intent gesture

UI

Ui Ui::Animations Ui::Controls Ui::Ime Ui::Scenes UI::GestureDetector Ui::Effects

hardware.sensor speech os.vibrator

UX

Uix::Sensor Uix::Speech Uix::Vibrator

Page 27: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Native UI

Page 28: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

28

UI Structure – iOS

FOOTER

내부 그림 수정 왼쪽 저작권

오른쪽 맨 앞에 이쁜 그림으로 오른쪽 맨 앞그

림도 왼쪽 그림처럼

subview 만 표현 Table View

Tool Bar

Navigation Bar

UIWindow

Page 29: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

29

UI Structure – Android to Tizen

내부 그림 수정 왼쪽 저작권

오른쪽 맨 앞에 이쁜 그림으로 오른쪽 맨 앞그

림도 왼쪽 그림처럼

subview 만 표현

Indicator Action bar

View

Widgets

Page 30: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

30

UI Structure – Android to Tizen

내부 그림 수정 왼쪽 저작권

오른쪽 맨 앞에 이쁜 그림으로 오른쪽 맨 앞그

림도 왼쪽 그림처럼

subview 만 표현

http://developer.android.com

Frame

Panel

Form

Control Control

Control Control Control

Page 31: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

31

Controls - Tizen

Page 32: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

32

Controls – iOS Label

Round Rect Button

Segmented Control

Text field

Slider

Switch

Active indicator view

Progress view

Page control

Stepper

Table view

Table view cell

Collection view

Collection view cell

Collection reusable view

Image view

Text view

Web view

Map view

Scroll view

Date picker

Picker view

Ad Banner view

GLKit view

View

Container view

Navigation bar

Navigation item

Search bar

Search bar and search display controller

Toolbar

Bar button item

Fixed space bar button item

Flexible space bar button item

Tab bar

Tab bar item

Page 33: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

33

Controls – iOS vs. Tizen (native) Label

Round Rect Button

Segmented Control

Text field

Slider

Switch

Active indicator view

Progress view

Page control

Stepper

Table view

Table view cell

Collection view

Collection view cell

Collection reusable view

Image view

Text view

Web view

Map view

Scroll view

Date picker

Picker view

Ad Banner view

GLKit view

View

Container view

Navigation bar

Navigation item

Search bar

Search bar and search display controller

Toolbar

Bar button item

Fixed space bar button item

Flexible space bar button item

Tab bar

Tab bar item

Form

Page 34: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

34

Widgets – Android

Page 35: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

35

Android to Tizen - Layouts

Android Tizen

GridLayout Grid layout GridLayout Card layout Card layout

RelativeLayout Relative layout RelativeLayout LinearLayout Linear layout HorizontalBox

VerticalBox

FragmentLayout Fragment layout SplitPanel TableLayout Table layout TableView

Page 36: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

36

Android to Tizen - Form widgets

Android Tizen

TextView Label

Text TextBox Label

Button Button Button On/Off button Switch

On/Off Button

CheckButton (On/off Sliding Style

) Checkbox Checkbox Button CheckButton

(radio Style) Spinner Expanding Items Context Menu Rating, Contact badge

Pre-Made widgets

Custom Control

Page 37: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

37

Android to Tizen - Layouts

Android Tizen

ListView List View ListView

ExpandableList ExpandableList TableView

Grid View Grid View Panel & GridLayout

ScrollView Scrollable page ScrollPanel SearchView Search SearchBar Tab Tab Tab (Form proper

ty) WebView Web view WebControl

Page 38: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

38

Android to Tizen – Image, Medias, Data and Time Android Tizen

ImageView Image View Panel ImageButton Image Button Button(with image) Gallery Gallery Gallery VideoView Video View OverlayRegion

TimePicker Time Picker EditTime DatePicker Date Picker EditDate

CalendarView Date & Time Picker

DateTimePicker CustomControl

Chronometer, Digital Clock

Pre-Made widgets

CustomControl

Page 39: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

39

UI builder & Workflow – Tizen

Page 40: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

40

Interface Builder & Storyboard – iOS

Page 41: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

41

Using Interface Builder – Android

Page 42: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Application Life Cycle

Page 43: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

43

Tizen

Initializing

Create

Running Terminating

Terminated

-  Exit event loop. -  Call the OnAppTerminating()

method. -  Destroy allocated resources.

OnAppInitializing() return false

OnAppInitializing() return true

-  Call the OnAppInitialized() method.

-  Call the OnAppWillTerminate() method.

OnAppWillTerminate() return true

OnAppWillTerminate() return false

OnAppInitialized() return false

Page 44: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

44

Frame states

Page 45: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

iOS  to  Tizen

Page 46: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

46

iOS App Lifecycle - Status

Background

Active

Inactive

Not Running

Running

Suspended

Foreground

Page 47: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

47

Launching an app

Background

Active

Inactive

Not Running

Running

Suspended

Foreground

Page 48: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

48

Background

Launching an app

Active

Inactive

Not Running

Running

Suspended

Foreground

application: didFinishLaunchingWithOptions:

OnAppInitializing()

iOS Tizen

Page 49: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

49

Background

Launching an app

Active

Inactive

Not Running

Running

Suspended

Foreground

applicationDidBecomeActive:

OnAppInitialized()

iOS Tizen

Page 50: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

50

Background

Switching from an app

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

Page 51: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

51

Background

Switching from an app

Active

Inactive

Not Running

Running

Suspended

Foreground

applicationWillResignActive: OnWindowDeactivated()

iOS Tizen

Page 52: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

52

Background

Entering background

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

applicationDidEnterBackground:

OnBackground()

OnWindowStateChanged()

Page 53: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

53

Background

Entering background

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

OnAppCheckPointing()

Page 54: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

54

Background

Terminating

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

Page 55: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

55

Background

Terminating

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

applicationWillTerminate: OnAppTerminating()

OnTerminating()

Page 56: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

56

Background

Terminating

Active

Inactive

Not Running

Running

Suspended

Foreground iOS Tizen

Page 57: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Android  to  Tizen

Page 58: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

58

Life Cycle - Android vs. Tizen

Created

OnCreate() OnAppInitializing() Frame::OnInitializing()

Page 59: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

59

Life Cycle - Android vs. Tizen

Created

OnStart()

Started

Resumed

Foreground

Paused

Frame::OnWindowStateChanged()

Page 60: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

60

Life Cycle - Android vs. Tizen

Created

Started

Resumed

Foreground

Paused

OnResume()

Window::OnWindowActivated()

Page 61: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

61

Life Cycle - Android vs. Tizen

Created

Started

Resumed

Foreground

Paused OnPause()

Control::FocusLost()

Page 62: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

62

Android App Lifecycle - Status

Background

Started

Resumed

Paused

Stopped

Foreground

Destroyed

Background

OnStopped()

UIApp::OnBackground() Window::OnWindowDeactivated()

Page 63: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

63

Android App Lifecycle - Status

Background

Started

Resumed

Paused

Stopped

Foreground

Destroyed

Background

OnDestory()

OnAppWillTerminate() Frame::OnTerminating() OnAppTerminating()

Page 64: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

64

Android App Lifecycle - Status

Background

Started

Stopped

Foreground

Destroyed

Background

OnRestart()

Resumed

Paused UiApp::OnForeground() Frame::OnWindowActivated()

Page 65: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Event Handling

Page 66: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

iOS  to  Tizen

Page 67: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

67

Delegate vs. Listener

Handle the events from UI controls/outlets Protocol methods

Handle events from the registered controls Pre-defined virtual methods

Delegate Listener

67 I Porting iOS Apps to bada

Tizen iOS

Page 68: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

68

Connection between control, action and delegate has to be made from Interface builder

Connection between control and listener normally made by calling AddXXXListener()  function

Delegate vs. Listener

Delegate Listener

Handle the events from UI controls/outlets Protocol methods

Handle events from the registered controls Pre-defined virtual methods

Tizen iOS

Page 69: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

69

iOS Event Handling #import  <CoreMotion/CoreMotion.h>    @interface  RootViewController  :  UIViewController  {  @public    CMotionManager  *motionManager;  }  @property  (nonatomic,  retain)CMMotionManager  *motionManager;    

#import  “RootViewController.h”  @implementation  RootViewController  @synthesize  motionManager;    (Void  (^accelerometerHandler)  CMAccelerometerData  *,  NSError  *)  =  ^(CMAccelerometerData  *accelerometerData,  NSError  *error)  {    NSLog(@”X=  %.04f,  Y=%.04f,  Z=%.04F”,  accelerometerData.acceleration.x,  accelerometerData.acceleration.y,  accelerometerData.acceleration.z);    };    [self.motionManager  startAccelerometerUpdatesToQueue:  [NSOperationQueue  mainQueue]    withHandler:  accelerometerHandler];  

Page 70: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Android  to  Tizen

Page 71: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

71

Tizen Listener vs. Android Listener

class  myClickListener  :  public  Tizen::Ui::IActionEventListener  {    Button  *pButtonOK  //…  pButtonOk-­‐>AddActionEventListener(*myClickListener);  

class  myClickListener  implements  onClickListener  {    Button  button;  //…  Button.setOnClickListener(myClickListener)  

Tizen

Android

Page 72: Entering Tizen world for iOS & Android developers · 2013. 6. 6. · for iOS & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist 2 Contents 1. ... Application Life

Thank you