1 / 29

Tizen v2.3 Application Model

Tizen v2.3 Application Model. Sungkyunkwan University. 1. Web Application Model. 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

pennybrown
Télécharger la présentation

Tizen v2.3 Application Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tizen v2.3Application Model Sungkyunkwan University

  2. 1. Web Application Model

  3. 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

  4. Tizen Web App Ecosystem

  5. Web Runtime on Tizen v2.3 • Environment within which all web applications run on Tizen • To access local device and platform resources

  6. Tizen v2.3 Web Runtime Internal Blocks

  7. config.xml • <tizen:privilege> element. List any privileges application requires • <tizen:application id=“…”> attribute. Unique application identifier • <tizen:application required_version=“”> attribute. The minimum required platform on which the application can run • <tizen:app-control> To make use of certain functionality provided by another application • <tizen:app-widget> Show some dynamically updated content from another application directly on the home screen • Describes the web application itself • Follows W3C widget Spec, and Tizen-specific features • <name> : application name • <widget version=“x.y.z”> attribute • <content src=“start_file_name.html”/> • <icon src=“icon_file_name.png” /> • <author> • <feature>: Each feature has a corresponding URL from which you can obtain more information about the feature

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

  9. jQuery Mobile • 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

  10. jQuery Mobile (example) jQuery Mobile stylesheets jQuery library jQuery Mobile library

  11. Globalization • designing and developing applications that function for multiple cultures • jQuery.glob.all.js includes around 350 cultures (date, number, currency)

  12. 2. Native Application Model

  13. 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

  14. Native Application Model • 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 least-recently-used order until memory pressure has been relieved. • Multitasking priority level

  15. Native Application Model • 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

  16. 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

  17. Launching Application • 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()

  18. Terminating Application • 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)

  19. 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() • Terminated • App framework removes the app from memory • Running • While the UI app is running, it can switch between the background and foreground • During the switch, the window state of the app changes • The service app always runs in the background Paused • Application is not visible for the user

  20. Tizen User Interface • 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

  21. Frame State Transition • 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

  22. Registering a Launch Condition • 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

  23. Message Port • 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

  24. Uni-directional Communication • SendMessage() • send messages to another application • OnMessageReceivedN() • Another application can receive the messages

  25. Uni-directional Communication • 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

  26. Bi-directional Communication • 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

  27. Bi-directional Communication • 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

  28. Trusted Communication • 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

  29. Trusted Communication • 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

More Related