Entering Tizen world for ios & Android developers Cheng Luo, DukSu Han Samsung Platform Evangelist
Contents 1. Platform Overview 2. Frameworks 3. Native UI 4. Application Life Cycle 5. Event Handling 2
1. Platform Overview
Native ios Tizen Android Objective C C++ Java / C++ 4
IDEs ios Tizen Android 5
Target Device ios Tizen Android 6
2. Frameworks
8 Frameworks of Tizen
9 Frameworks of Tizen
10 Frameworks of Tizen
ios to Tizen
Framework of ios ios Cocoa touch Media Core services Core OS Accelerate Framework Core Bluetooth Framework External Accessory Framework Generic Security Service Framework Security Framework System 12
Framework of Tizen Tizen Cocoa touch Media Core services Core OS Tizen::Uix::Sensor Tizen::Net::Bluetooth Tizen::System::DeviceManager Tizen::Security Tizen::Base 13
Framework of ios ios Cocoa touch Media Core services Core OS 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 14
Framework of Tizen Tizen Cocoa touch Media Core services Core OS Tizen::Social::Addressbook Tizen::Net Tizen::Base Tizen::IO Tizen::Location Tizen::Media Tizen::Telephony Tizen::System::SystemInfo 15
Framework of ios ios Cocoa touch Media Core services Core OS 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 16
Framework of Tizen Tizen Cocoa touch Media Core services Core OS Tizen::Media Tizen::Graphics Tizen::Io Tizen::Text OpenGL ES OpenAL 17
Framework of ios ios Cocoa touch Media Core services Core OS Address Book UI Framework Event Kit UI Framework Game Kit Framework iad Framework Map Kit Framework Message UI Framework Twitter Framework UIKit Framework 18
Framework of Tizen Tizen Cocoa touch Media Tizen::App::AppControl Tizen::UI Core services Core OS 19
Android to Tizen
Application Framework Android api17 vs. Tizen2.1 Android Tizen Activity UI application UI application Service Content Provider App Widgets Preference Intent(Call Action) Binder(IPC) Non-UI application Home Screen Widget App Service Application App::SqlDataControlProvider App::MapDataControlProvider Shell::AppWidgetProvider AppRegistry AppControl MessagePort(IAC) 21 Copyright 2012 Samsung Electronics, Co., Ltd. All rights reserved. 21
Base Android(android.) java.lang collection util(regexp,zip) util(locale,timezone) Base Collection Utility Tizen(Tizen::) Base, Text Base::Collection Collection::stlConverter(STL) Base::Utility, Base::Locales util.concurrent(lock, semaphore ) os (system info.) hardware.inpu t IO Database Thread System Base::Runtime System(system info.,external device ) IO IO IO::Database 22
Graphics & Multimedia Android(android.) Graphics (Canvas) Opengl (1.1, 2.0) Media.mediaplayer - Audio, Video - Streaming hardware.camera media:facedetector Graphics Multimedia Tizen(Tizen::) Graphics (Canvas) Graphics::Opengl (1.1,2.0) Media::Player - Audio, Video - Streaming: http,rtsp Media::Camera Uix::Vision(Facedetector, Imag e Recognizer, QR code) 23
Communication Android(android.) net bluetooth net.http Java.socket net.wifi nfc telephony Notification Communication Tizen(Tizen::) Net Net::Bluetooth Net::Http Net::Sockets Net::Wifi Net::Nfc Telephony Messaging(sms,mms,em ail,push receive) 24
Web & Contents Android(android.) Webkit Webkit.webview org.json org.xml, javax.xml Web Web Web::Controls Web::Json Libxml2 Tizen(Tizen::) 25
User Interface Android(android.) View view.animation View.widget view.inputmethodservice Activity, Intent gesture hardware.sensor speech os.vibrator UI UX Ui Ui::Animations Ui::Controls Ui::Ime Ui::Scenes UI::GestureDetector Ui::Effects Uix::Sensor Uix::Speech Uix::Vibrator Tizen(Tizen::) 26
Native UI
UI Structure ios UIWindow Navigation Bar FOOTER Tool Bar Table View 28
UI Structure Android to Tizen Indicator Action bar Widgets View 29
UI Structure Android to Tizen Frame Form Panel Control Control Control Control Control 30
Controls - Tizen 31
Controls ios Label Table view Date picker View Tab bar Round Rect Button Table view cell Picker view Container view Tab bar item Segmented Control Collection view Ad Banner view Navigation bar Text field Collection view cell GLKit view Navigation item Slider Collection reusable view Search bar Switch Image view Search bar and search display controller Active indicator view Text view Toolbar Progress view Web view Bar button item Page control Map view Fixed space bar button item Stepper Scroll view Flexible space bar button item 32
Controls ios vs. Tizen (native) Label Table view Date picker Form View Tab bar Round Rect Button Table view cell Picker view Container view Tab bar item Segmented Control Collection view Ad Banner view Navigation bar Text field Collection view cell GLKit view Navigation item Slider Collection reusable view Search bar Switch Image view Search bar and search display controller Active indicator view Text view Toolbar Progress view Web view Bar button item Page control Map view Fixed space bar button item Stepper Scroll view Flexible space bar button item 33
34 Widgets Android
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 35
Android to Tizen - Form widgets Android TextView Label Text Tizen 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 bad ge Pre-Made widgets Custom Control 36
Android to Tizen - Layouts Android Tizen ListView List View ListView ExpandableList ExpandableList TableView Grid View Grid View Panel & GridLayo ut ScrollView Scrollable page ScrollPanel SearchView Search SearchBar Tab Tab Tab (Form proper ty) WebView Web view WebControl 37
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 Chronometer, Digit al Clock Date & Time Picke r Pre-Made widgets DateTimePicker CustomControl CustomControl 38
39 UI builder & Workflow Tizen
40 Interface Builder & Storyboard ios
41 Using Interface Builder Android
Application Life Cycle
Tizen Create Initializing OnAppInitializing() return false Terminated OnAppInitializing() return true OnAppInitialized() return false - Call the OnAppWillTerminate() method. - Call the OnAppInitialized() method. Running OnAppWillTerminate() return true Terminating OnAppWillTerminate() return false - Exit event loop. - Call the OnAppTerminating() method. - Destroy allocated resources. 43
44 Frame states
ios to Tizen
ios App Lifecycle - Status Foreground Active Inactive Not Running Running Background Suspended 46
Launching an app Foreground Active Inactive Not Running Running Background Suspended 47
Launching an app ios Foreground Tizen Active Inactive OnAppInitializing() application: didfinishlaunchingwithoptions: Not Running Running Background Suspended 48
Launching an app ios Foreground Tizen Active OnAppInitialized() applicationdidbecomeactive: Inactive Not Running Running Background Suspended 49
Switching from an app ios Foreground Tizen Active Inactive Not Running Running Background Suspended 50
Switching from an app ios Foreground Tizen Active applicationwillresignactive: Inactive OnWindowDeactivated() Not Running Running Background Suspended 51
Entering background ios Foreground Tizen Active Inactive Not Running applicationdidenterbackground: Running Suspended OnBackground() OnWindowStateChanged() Background 52
Entering background ios Foreground Tizen Active Inactive Not Running Running Suspended OnAppCheckPointing() Background 53
Terminating ios Foreground Tizen Active Inactive Not Running Running Background Suspended 54
Terminating ios Foreground Tizen Active Inactive Not Running applicationwillterminate: OnAppTerminating() Running OnTerminating() Background Suspended 55
Terminating ios Foreground Tizen Active Inactive Not Running Running Background Suspended 56
Android to Tizen
Life Cycle - Android vs. Tizen OnCreate() Created OnAppInitializing() Frame::OnInitializing() 58
Life Cycle - Android vs. Tizen Frame::OnWindowStateChanged() Created OnStart() Foreground Started Resumed Paused 59
Life Cycle - Android vs. Tizen Window::OnWindowActivated() Created Foreground Started OnResume() Resumed Paused 60
Life Cycle - Android vs. Tizen Control::FocusLost() Created Foreground Started Resumed OnPause() Paused 61
Android App Lifecycle - Status Foreground Started Resumed UIApp::OnBackground() Window::OnWindowDeactivated() Background Paused Stopped OnStopped() Background Destroyed 62
Android App Lifecycle - Status Foreground Started Resumed OnAppWillTerminate() Frame::OnTerminating() OnAppTerminating() Background Paused Stopped OnDestory() Destroyed Background 63
Android App Lifecycle - Status Foreground OnRestart() Started Resumed UiApp::OnForeground() Frame::OnWindowActivated() Background Paused Stopped Destroyed Background 64
Event Handling
ios to Tizen
Delegate vs. Listener Delegate ios Listener Tizen Handle the events from UI controls/out lets Protocol methods Handle events from the registered con trols Pre-defined virtual methods 67 I Porting ios Apps to bad a67
Delegate vs. Listener Delegate ios Listener Tizen Handle the events from UI controls/out lets Protocol methods Connection between control, action an d delegate has to be made from Interfa ce builder Handle events from the registered con trols Pre-defined virtual methods Connection between control and listen er normally made by calling AddXXXLis tener() function 68
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, ac celerometerdata.acceleration.z); }; [self.motionmanager startaccelerometerupdatestoqueue: [NSOperationQueue mainqueue] withhandler: accelerometerhandler]; 69
Android to Tizen
Tizen Listener vs. Android Listener Tizen class myclicklistener : public Tizen::Ui::IActionEventListener { Button *pbuttonok // pbuttonok- >AddActionEventListener(*myClickListener); Android class myclicklistener implements onclicklistener { Button button; // Button.setOnClickListener(myClickListener) 71
Thank you