Tizen Kernel

Tizen Kernel

1 29 Tizen v2.3 Application Model Sungkyunkwan University Embedded Software Lab. @ SKKU 2 29 1. Web Application Model Embedded Software Lab. @ SKKU What is Web app and Web Runtime Web application Using web based technologies (HTML/JS/CSS/etc.) Accessing local device / platform resources Can be installed on the device

Web Runtime Package management (installation, update, etc.) Execution and lifecycle (launching, pause, resume, etc.) Runtime security (API/network access, sandboxing, etc.) Device and platform integration Embedded Software Lab. @ SKKU 3 29 Tizen Web App Ecosystem Embedded Software Lab. @ SKKU 4 29

Web Runtime on Tizen v2.3 5 Environment within which all web applications run on Tizen To access local device and platform resources Embedded Software Lab. @ SKKU 29 Tizen v2.3 Web Runtime Internal Blocks Embedded Software Lab. @ SKKU 6 29 7

config.xml 29 Describes the web application itself Follows W3C widget Spec, and Tizen-specific features : application name attribute : Each feature has a corresponding URL from which you

can obtain more information about the feature element. List any privileges application requires attribute. Unique application identifier attribute. The minimum required platform on which the application can run To make use of certain functionality provided by another application Show some dynamically updated content from another application directly on the home screen

Embedded Software Lab. @ SKKU Tizen Web UI framework 8 Based on open-source javascript libraries Such as jQueryMobile, jQuery, Globalize Provide a large set of widgets that have the same look and feel Embedded Software Lab. @ SKKU 29 jQuery Mobile

9 Overview Touch-optimized JavaScript framework for developing mobile web application Includes optimized functions such as UI controls, event handler, animation effects, and Ajax communication Consists of HTML, CSS, JavaScript HTML5-based user interface system designed to make responsive web sites and apps data-* attributes: data-role, data-theme, data-position, data-transition, data-icon Supported platforms Apple iOS, Android, Windows Phone, Blackberry, Palm WebOS, Firefox Mobile, Chrome for Android, Skyfire, Opera Mobile, Meego, Tizen, Samsung Bada, Kindle, Downloads From jquerymobile.com or using jQuery Mobile CDN (Contents Delivery Network) Comparison with Sencha Touch

Superior in terms of portability, performance, entry barrier, and library size Embedded Software Lab. @ SKKU 29 10 jQuery Mobile (example) 29 jQuery Mobile stylesheets jQuery library jQuery Mobile library Embedded Software Lab. @ SKKU Globalization 11

designing and developing applications that function for multiple cultures jQuery.glob.all.js includes around 350 cultures (date, number, currency) Embedded Software Lab. @ SKKU 29 12 29 2. Native Application Model Embedded Software Lab. @ SKKU Native Application UI applications Which have a graphical user interface Only one of them can be in the foreground at a time

Service applications Which do not have a graphical user interface (background) Displayed by Task switcher (which provides the list of all running applications), but no event occurs if the user selects Useful in performing activities that need to run periodically or continuously, but do not require any user intervention Embedded Software Lab. @ SKKU 13 29 Native Application Model 14 Multitasking in Tizen

Supported but only one Tizen UI application can run in the foreground while the remaining applications run in the background Determine which UI application is running on the foreground Using the task switcher Using main menu icons Termination when the End key or the system memory is low Out of Memory Policy low-memory killer will zap background applications in leastrecently-used order until Low memory pressure has been relieved. Background UI applications Multitasking priority level Service applications Background media players Foreground UI application Foreground media player Application launcher High Voice or video call, or other system applications Embedded Software Lab. @ SKKU

29 Native Application Model 15 Handling System Events Battery Events Check the battery level of the device using OnBatteryLevelChanged() or OnBatteryLevelChangedInPercentage() event handler Ex) EMPTY; terminate the application, CRITICAL; stop using multimedia features Memory Events Free unused memory form the heap using the OnLowMemory() event handler Screen Events (applicable only to UI applications) When the OnScreenOff(), reduce power consumption by releasing the activated resources (such as 3D, media, and sensors) which are no longer used to enter the sleep mode

Checkpoint Events To avoid losing data due to unexpected termination, save the application state or context to the application registry or to the device storage using OnAppChechpointing() event handler Embedded Software Lab. @ SKKU 29 Life Cycle of Native Applications A frame is created by UI application, initialized with app_create_cb() After the application is initialized, it can handle events and its state is set to running

The application gets to release its resources when the app_terminate_cb() event handler is called Embedded Software Lab. @ SKKU 16 29 Launching Application 17 Launching UI app; from the main menu, task switcher, a running application or when a registered condition is met Service app; from another application When starts,

Process Manager loads the necessary libraries and executable binary into the memory Instance of the application is created, executed in main() Initializing, previous application states are loaded, ui_app_main() Embedded Software Lab. @ SKKU 29 Terminating Application 18 When, Tizen native application itself calls the Terminate() The system forced the application to shut down Memory or battery power is extremely low Handled in the app_terminate_cb()

Free its resources and terminates Allocated UI controls, such as the form and its child controls are also released save the application's states into application registry urgent termination triggered by the power-off and OOM this method is not likely to be called, so the application should save the critical data as often as possible. (check point or callback for low memory) normal termination triggered by self or other applications this method is executed properly (more time but limit of 3-5 seconds) Embedded Software Lab. @ SKKU 29 Application State Transition Initializing

App framework initializes the application The app data saved on the previous run is restored For UI app, the app's frame must be created and added explicitly in app_create_cb() 19 Terminated App framework removes the app from memory Running While the UI app is running, it can switch between the background and foreground Paused During the switch, the window state of the app Application is not visible for the user changes The service app always runs inEmbedded the background Software Lab. @ SKKU 29 Tizen User Interface

20 full-screen Tizen::Ui::Controls::Frame container that creates the top-level window There must be at least one frame per application The form in turn contains the indicator bar, header, footer, and UI controls There can be multiple forms per application Embedded Software Lab. @ SKKU 29 Frame State Transition 21 One frame in a UI application which is the top-level main window

The frame has three states State: Activated Status: Fully visible, receive input Triggered by: 1. User selects the application on task switcher 2. User presses the main menu icon 3. A window that had caused the application to become deactivated is terminated State: Deactivated Status: No input to deactivated frame, partially shown Triggered by: 1. Another frame is located on top of the current frame 2. Another window, such as an incoming call, pop-up, or alarm is displayed State: Minimized Status: Invisible, Graphic / media processing and sensor manipulations are discontinued Triggered by: 1. HOME key is pressed 2. Another UI application has been launched Embedded Software Lab. @ SKKU

29 Registering a Launch Condition 22 Register application with specific launch conditions When the launch conditions are met, the registered application is launched automatically Registration At runtime, AppManager::RegisterAppLaunch() method with privilege http://tizen.org/privilege/application.launch At application installation, by specifying the condition in the manifest file Type Condition format Description

Due time L"DateTime= 'mm/dd/yyyy hh:mm:ss'" Launch at the wall time, 'mm/dd/yyyy hh:mm:ss'. Period L"DueTime= 'mm/dd/yyyy hh:mm:ss' LaunchPeriod='mm'" Launch at the wall time, 'mm/dd/yyyy hh:mm:ss', and every 'mm' minutes. The launch period must be between 60 minutes and 10 years. Serial L"Serial='keyword'"

Launch when receiving 'keyword' as serial communication input. NFC L"NFC='command'" Launch when receiving 'command' as Near Field Communication (NFC) tag with NFC Data Exchange Format (NDEF) data. Embedded Software Lab. @ SKKU 29 Message Port 23 Tizen::Io::MessagePortManager class All Tizen native applications can communicate with each other using a MessagePort The message data type is a map data which consists of a key and value pair (Tizen::Base::String)

2 types of message ports The Tizen::Io::LocalMessagePort class To receive messages from the another application, set the Tizen::Io::IMessagePortListener interface from the local message port. The Tizen::Io::RemoteMessagePort class To send messages to other applications The local message port information can be sent to the other application for bi-directional communication Embedded Software Lab. @ SKKU 29 Uni-directional Communication SendMessage() send messages to another application

OnMessageReceivedN() Another application can receive the messages Embedded Software Lab. @ SKKU 24 29 Uni-directional Communication 25 In the server application, Tizen::Io::LocalMessagePort::RequestLocalMessagePort() Requests a LocalMessagePort instance with the specified message port name AddMessagePortListener() Receive message from the client application OnMessageReceivedN() Handle the received messages from the client application

In the client application, Tizen::Io::LocalMessagePort::RequestRemoteMessagePort() Retrieve the RemoteMessagePort instance with specified remote application ID and message port name SendMessage() Send messages from the client application to the server application Embedded Software Lab. @ SKKU 29 Bi-directional Communication 26 SendMessage() Send messages and local message port information to another application This local message port information can be used to send the response

messages from the other application which receives these messages OnMessageReceivedN() Receive the messages The remote message port information can be used to send response messages to the application which sends the messages Embedded Software Lab. @ SKKU 29 Bi-directional Communication 27 In the server application, Tizen::Io::LocalMessagePort::RequestLocalMessagePort() Requests a LocalMessagePort instance with the specified message port name AddMessagePortListener() Receive message from the client application

OnMessageReceivedN() Handle the received messages from the client application Respond back using the RemoteMessagePort instance received from the client application In the client application, RequestRemoteMessagePort() / RequestLocalMessagePort() Retrieve the RemoteMessagePort/LocalMessagePort instance with specified remote application ID and message port name / just message port name SendMessage() Send messages from the client application to the server application OnMessageReceivedN() Handle the received messages from the server application Embedded Software Lab. @ SKKU 29 Trusted Communication

28 Application controls and data controls Create the author certificated and register the created certificate to IDE Execute certificate-generator.sh or certificate-generator.bat with shell Output is pkcs12 file Give permission by application certificate in the manifest editor Other applications with which have the same permission can access the exported functionality of the application Message port communication RequestTrustdLocalMessagePort(), RequestTrustedRemoteMessagePort() Get the trusted message port instance Only if both applications are signed with a certificate that is uniquely assigned to its developer Embedded Software Lab. @ SKKU

29 Trusted Communication 29 Trusted shared directory To share trusted data GetAppSharedPath() to get the trusted shared directory of the target application If other applications try to access this path, the E_ILLEGAL_ACCESS error Embedded Software Lab. @ SKKU 29

Recently Viewed Presentations

  • GoldSim Workshop

    GoldSim Workshop

    The Interrupt element is another element that can be triggered by events. However, it is not used to actually represent a feature or a process in a model. Rather, it is used to help you debug and test complex models...
  • What's Inside a TESLA Cryomodule

    What's Inside a TESLA Cryomodule

    CERN's LHC current leads for currents above a few 100 amps are HTS leads, helium gas cooled from nominally 20 K gas . See reference 7 for more information . The Fermilab/Berkeley collaboration incorporated 7.5 kA HTS current leads into...
  • 1- Vrai ou faux? Lalcool augmente le rythme

    1- Vrai ou faux? Lalcool augmente le rythme

    Réponse 24 La méthamphétamine se présente généralement sous forme de comprimés (speed), de capsules, de poudre ou bien de cristaux (crystal meth).
  • Animal Science 434

    Animal Science 434

    Terminology Estrus is a noun. ... days 35 year olds 28 days Variation More in teenagers Less in women in peak reproductive years Animal Science 434 Reproductive Cyclicity in the Female Terminology Estrus is a noun. ... Short Spontaneous Spontaneous...
  • Organizational Design - Seattle University

    Organizational Design - Seattle University

    4. Work teams - cross-functional (integrated) autonomous, self-managed, leaderless etc. 5. The Job characteristics model is a description of the job!!!! Job characteristics critical Psy states outcomes a. How do you find out if job has characteristics? MPS = (skill...
  • Click to edit Master title style - Oregon State University

    Click to edit Master title style - Oregon State University

    www.bsg-online.com, you are automatically routed to your company's "Corporate Lobby" web page. The Corporate Lobby page is your . gateway to . all . BSG activities. Near the top of this page is a series of menu selections that provide...
  • Active and Passive Verbs

    Active and Passive Verbs

    Active and Passive Verbs Active When the subject of the sentence is doing something the verb is active. E.g. The man wore a grey hat. Subject - man verb - wore object - hat Passive When the object of the...
  • Linux Thread Programming - Arizona State University

    Linux Thread Programming - Arizona State University

    Linux Thread Programming. Computer Science & Engineering Department. Arizona State University . Tempe, AZ 85287. Dr. Yann-Hang Lee. [email protected] (480) 727-7507