Download presentation
Presentation is loading. Please wait.
1
Tizen v2.3 Web Framework
2
Contents Web Runtime Tizen Web API Internal Blocks
Feature and Lifecycle Tizen Web API Web Device API, Tizen API, Application API, Communication API, Content API, Input/Output API, Social API, System API, User Interface API 다음과 같은 순서 Web framework W3C 표준의 web api와 서드 파티 API, 그리고 타이젠 장치에 접근을 가능하게 하는 device API들을 제공, 또한 UI framework도 포함되어 web app의 Web runime Web apis Device apis Web view
3
Web Application Web application Using web based technologies
Accessing local device / platform resources Can be installed on the device 웹 어플리케이션은 web framework에서 제공되는 W3C/HTML5 spec, miscellaneous Web spec, tizen web spec과 같은 web based tech를 이용하여 실행된다. 왼쪽에 보이는 website 역시 web application이다. W3C API를 이용하고, 시스템의 리소스를 사용한다. 따라서, web based tech를 사용하게 된다. 다른 점은 website는 install 할 필요가 없다. 단지, url입력하고, webkit에 rendering요청 하면 그만. Web runtime은 web application이 실행되도록 하는 framework이다. web application의 install 작업을 해준다. 뿐만 아니라, launch 및 device API를 사용하여 device에 접근가능하도록 API를 제공하는 것 역시 Web runtime의 역할 이렇게 web rumtime으로 web application 관리를 integrate함으로써, web application은 task manager, package manager와 통합될 수 있다. OOM, local change, orientation 같은 시스템 이벤트를 받을 수 있다. Source: Ming Jin , Tizen Web Runtime. Tizen Developer Conference 2012.
4
Web app on the Web framework
aggregates the Web Runtime along with the W3C API, Device API, and a UI framework containing widgets derived from jQuery Mobile One of the most important components is the Tizen Web Runtime, the component that allows web apps to run outside the browser. Tizen users can install and use web apps as if they were standalone applications, and the Web Runtime manages the life cycle, system calls, execution, resources, platform integration, and access control of the web app [Jin01][Mtsc01]. Similarly named, the Web Framework aggregates the Web Runtime along with the W3C API, Device API, and a UI framework containing widgets derived from jQuery Mobile. By exposing the standard W3C and unique Device APIs, Tizen offers added value to web apps that could otherwise only render HTML and carry out generic JavaScript. The Tizen W3C API implements web standards relating to DOM, styles, device, graphics, media, communication, storage, security, UI, performance, location, and widget. The Device API provides advanced logic employing sensors, file I/O, capturing, telephony, FM radio, speech recognition, HDMI output, and more. 웹 애플리케이션을 위한 프레임워크이며 다양한 최신 웹 기술을 지원한다. HTML5 API, 비디오, 오디오, 폼, 2D 캔버스, WebGL, CSS3, 웹소켓, 웹 워커 등과 같이 W3C 및 여러 표준화 단체에서 정의한 표준을 지원한다. 그리고 표준에서 제공하지 못하는 부족한 부분을 채우기 위해 블루투스, NFC, 알람, 메시징 등의 다양한 디바이스 API를 제공하고 있다. 또한 웹 애플리케이션 실행, 라이프 사이클 관리, 접근 제어 등의 역할을 하는 Web Runtime도 제공하고 있다. 웹 프레임워크 중 UI 프레임워크는 jQuery 모바일을 사용하고 있다. Source: Jaesik Chang , Tizen Webkit For Wearable Devices. Tizen Developer Conference 2014.
5
Web framework Provides: Consists of:
Best Web experience with Browser and packaged Web Apps Focusing on functionality(HTML5), performance (UI Responsiveness, 2D/3D Acceleration, JS Engine), Standard Compliance(W3C) More device feature accessibility through Tizen Device API jQuery Mobile based Tizen Web UI FW enables easy Web App development Consists of: Web Runtime: Execution environment for packaged Web App WebView (WebKit2/EFL): JavaScriptCore, WebCore(HTML5/W3C API implementation), WebKit API 저전력 디바이스에 최적화된 Tizen 웹 API의 완전한 구현을 제공한다. 이는 웹 브라우저가 웹 페이지를 렌더링하도록 설계된 레이아웃 엔진의 웹킷을 포함. 또한, 웹 어플리케이션을 위한 웹 런타임도 포함 Source: Sunil Saxena , Tizen Architecture. Tizen Developer Conference 2012.
6
Web UI Framework Launching Flow
7
Web UI Framework Launching Flow
8
Web Runtime: Internal Blocks
9
Web Runtime on Tizen v2.3 Web Runtime
Environment within which all web applications run on Tizen Package management (installation, update, etc.) Execution and lifecycle (launching, pause, resume, etc.) Runtime security (API/network access, sandboxing, etc.) Device and platform integration(access local device and platform resources) Web Runtime – Lifecycle Management of web applications – Execution of web application – Access to device resources via JS API – Device and Platform integration – Access control of web applications Web Runtime은 타이젠에서 돌아가는 모든 웹앱이 갖는 환경이다. 웹앱이 로컬 디바이스나 플랫폼 리소스들 (하드웨어, 네트웍, 파일시스템 등)에 접근하게 해준다. 말하자면 웹앱의 능력을 향상시키면서 설치, 실행, 보안을 관리하는 역할을 한다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
10
Tizen Web Runtime Internal Blocks
Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
11
web-launchpad-daemon
Web Runtime web wrt src view view_module.cpp IVewModule class pointing to ViewLogic webkit Injected-bundle Injected-bundle.cpp Load libraries to Webprocess dynamically view_logic.cpp ViewLogic(), createWebView(), prepareView(), showWidget(), hideWidget() api_new core_module.cpp CoreModule::Init(), Terminate() runnable_widget_object.cpp Show(), Hide(), Suspend(), Resume(), Prepareview() web-client wrt-client.cpp WrtClient::WrtClient(), OnStop(), OnCreate(), OnReset() wrt-common web-launcher wrt-launcher.cpp Display_widget_info(), AttachDB() web-launchpad-daemon launchpad_src launchpad.c wrt-installer __real_launch() __normal_fork_exec() __fake_launch_app() __prepare_exec() wrt-security wrt-security ace._client.cpp checkFunctionCall()
12
Tizen Web Runtime Internal Blocks
WRT Installer After download is finished, install the resources to the appropriate directories Register app to WRT database Extract content of the package file Check configuration file Generate manifest file for interacting with native application Update SMACK (Simplified Mandatory Access Control Kernel) policy based on requested privileges Web Runtime Installer: 시스템이 타이젠에 웹 어플리케이션을 설치할 때 호출된다. 스토어나 웹사이트에서 다운로드된 후 이 컴포넌트가 디바이스에 앱설치를 돕는다. 앱은 Web Runtime Database에 configuration file에 제공되는 정보를 사용해 등록된다. (application ID, package ID, name of app 등..) 설치 도중 패키지 파일 내용은 추출되고 configuration file은 확인되고 리소스들은 디바이스의 적합한 디렉토리에 설치되고 manifest file은 네이티브 앱과 연결하기 위해 생성된다. Simplified Mandatory Access Control Kernel (SMACK) 정책 규정들이 앱의 config.xml 파일에 요구되는 privilege와 사용자 선택에 기반해서 업데이트 된다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
13
Tizen Web Runtime Internal Blocks
WRT Client Callback related to the life-cycle (launch, resume, pause, terminate) When new web application is launched, the system spawns two processes UI process; manage the life cycle of an app Web process; responsible for rendering the web content Web Runtime Client: Runtime Core위에서 돌아간다. 어플리케이션 라이프사이클에 관련된 콜백을 구현하는데 네이티브와 웹 겸용이다. 웹 런타임 렌더링 엔진은 Webkit2 기반이다. 새로운 웹앱이 런치되면 시스템은 UI process, Web process 두 개의 프로세스를 만든다. UI는 앱의 라이프사이클을 관리하고, web은 웹 콘텐트를 렌더링한다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
14
Tizen Web Runtime Internal Blocks
WRT Core Core module Initialize the database, prepare information for launching, check network access View module Creation / deletion web view which contain a web application’s content Control view layer including the capability of show, hide, suspend Use WebKit and EFL Evas canvas library for view layer Resource loading, creation of new web view Add custom JS objects to WebKit view to access Tizen device APIs Web Runtime Core: core, view 두 가지 모듈 라이브러리로 구성되어 있다. Core는 Web Runtime의 다른 컴포넌트에서 사용되는 데이터베이스를 초기화하고 웹앱 런칭을 위한 정보를 준비한다. 중요한 클래스로 RunnableWidgetObject 클래스는 주어진 창에서 웹앱을 조작하고 구동하는 역할을 하고 이 클래스의 메소드들은 웹앱의 상태가 변화할 때 돌아간다. Core 모듈은 웹앱의 네트워크 접근 설정도 확인한다. View 모듈은 웹앱 내용을 담는 웹뷰를 관리한다. IViewModule이라는 인터페이스 클래스를 얻어서 웹앱의 뷰 레이어를 조작하는 메소드들을 사용해 보여주거나 숨기거나 확장시키는 게 가능하다. View 모듈은 ViewLogic이라는 클래스도 얻는데 WebKit과 EFL Evas canvas 라이브러리를 사용하는 것이다. 이것들을 사용하면 geolocation, web notification 등 플러그인 사용이 가능해진다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
15
Web core RunnableWidgetObject ViewLogic
Handle or launch web application at window Call proper methods at every state changes Definition of IRunnableWidgetObject interface web/wrt/src/api_new/i_runnable_widget_object.h Implementation of RunnableWidgetObject web/wrt/src/api_new/runnable_widget_object.cpp ViewLogic With Webkit and Evas library, geolocation, notification, plugin function is available
16
Web core IViewModule
17
ViewLogic
18
createWebView()
19
Tizen Web Runtime Internal Blocks
Injected Bundle Build a process management mechanism inside the WebKit API layer Support additional function to Web Process by loading library dynamically at startup time like plugin Unlike plugin, only one shared library can be loaded 타이젠에서는 플러그인 같이 온디맨드로 Tizen Device API를 로드하는 Injected Bundle을 사용한다. injectedBundle은 WebKit2에서 새로 등장한 개념으로 WebProcess에 기존 방법으로 추가하기 어려운 기능을 plugin 처럼 startup 시간에 동적으로 라이브러리(by dlopen)를 로딩하여 해당하는 기능을 지원하는 것입니다. Igalia의 Carlos 가 webkit-gtk 메일링리스트 쓴 글에 따르면, 현재 WebKit2의 InjectedBundle은 일반적인 plugin 과 달리 오직 하나의 shared library 로드 만을 지원하고 있습니다. 현재 WebKit2 InjectedBundle은 DOM binding, intent, back/forward list 등을 지원하고 있습니다. 이 개념이 왜 WebKit2에 반영이 되었을까에 대해서 추측을 해보자면, WebKit2의 기본 구조에서 유추해 볼 수 있을 것 같습니다. 기본적으로 WebKit2 모델은 WebProcess와 UIProcess 로 이루어져 양 프로세스간의 IPC 통신으로 데이터를 주고 받고 있습니다. 이러다 보니 모든 기능을 구현하기 위해서는 proxy 를 만들고 서로 통신을 해야 하는데 이 경우 너무 불필요한 작업을 많이 해야한 경우가 발생하는 것이죠. WebKit2 provides a way to inject code in the web process to do some things that are impossible to do other ways. It works like a plugin, loaded by the web process with dlopen at startup. Only one injected bundle client is supported by the web process. There's an InjectedBundle API in WebKit2/WebProcess/InjectedBundle/ very similar to the UIProcess C API. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
20
Tizen Web Runtime Internal Blocks
WRT Security Provide sandbox environment Enforce SMACK rules Cannot access the files of another application, system files or features unless it has been granted permission Web Runtime Security: 백그라운드에서 daemon를 돌린다. 앱이 다른 어플리케이션 파일에 접근하거나 시스템 파일을 읽거나 하지 않기 위해SMACK 규칙을 강제하는 sandbox 환경을 제공한다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
21
Tizen Web Runtime Internal Blocks
WRT Launchpad Preload WebKit and WRT libraries (such as libewebkit2.so, wrt-client) Fork a new process (UI process) Launchpad는 WebKit과 Web Runtime 라이브러리를 미리 로드한다. 이를테면libewebkit2.so와 wrt-client이다. 새로운 프로세스를 포크하고 새로 런치된 앱을 configuration information에 등록한다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
22
Launchpad Two key daemons to spawn new process(app) in TIZEN
AMD (application management daemon) and launchpad daemon. AMD receives the launch request and forwards it to the launchpad (launchpad_preloading_preinitializing_daemon) launchpad is the parent process of all TIZEN apps. There are three launchpad daemons; launchpad, wrt_launchpad and debug_launchpad AMD chooses the proper launchpad daemon w.r.t. launch request. debug_launchpad itself is launched by sdbd (sdb daemon) only for debugging purpose.
23
Web Runtime: Features and Lifecycle
24
Web Runtime on Tizen Since Tizen 2.0 Hosted web app support
Installation / Update flow improvement WebKit2/EFL Improvement of launching Resources encryption / decryption Web dynamic box support Support system language change Privilege-based API security Process sandboxing Web Runtime – Lifecycle Management of web applications – Execution of web application – Access to device resources via JS API – Device and Platform integration – Access control of web applications Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
25
Hosted Web App Support Hosted web app Restrictions
A Web app with all of its resources located on a remote server For now, it needs to be packaged with minimal resources: config.xml, signature(s) Restrictions Start page should be specified in <tizen:content> extension All of rendered pages are remote pages Only W3C/HTML APIs are allowed in remote pages Created browsing context has the same origin as remote server origin Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
26
Installation/Update flow improvement
Installation Flow New verification steps introduced Higher-level privilege declaration is not allowed Invalid signature is not allowed New installation steps introduced Resource encryption (if necessary) Smack rules population Update Flow Update criteria Must have the same Tizen app ID Must have the same author signature Update triggering point At installation request time, if the request satisfies the “update criteria” Update result Web app data (settings, cookies, local storage etc.) must be preserved Installation flow • Higher-level privilege declaration is not allowed • Invalid signature is not allowed • New installation steps introduced: • Resource encryption (if necessary) • Smack rules population Web app update flow • Must have the same Tizen App ID • Must have the same author signature Update triggering point: • At installation request time, if the request satisfies the “update criteria” Update result: • Web App data (settings, cookies, local storage etc.) must be preserved Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
27
Installation/Update flow
1. WRT-INSTALLER 2. Plugins installed? 2.N - Install plugins, copy plugins lib – store feature in wrt.db 3.Y – Decrypt WGT if it is a DRM WGT 4. Parsing config.xml file 5. Certify + encryption JOBS 6. App info registering: insert name, start file, mime, operation, type … in app_info.db Manifest file generation and insert it in pkgmgr_parser.db Desktop file generation 7. Certificate generation, insert certificate info in pkgmgr_cert.db 8. WRT APP info Registering: insert feature/plugins used, icon, locales … in wrt.db insert cetificate info in ace.db insert all privileges (access to device) needed by app in security 유 (used by WRT-Security) 9. Resource security check: check device access check smack access 10. APP installed Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
28
Based on WebKit2/EFL Web App Process Model
Each Web app has 1 UI process and 1 web process UI process manages lifecycle, and Web process is responsible for rendering NPAPI plugins (if any) will run in separate processes NPAPI는 90년대 나온 기술이지만 지금도 대부분의 브라우저 플러그인 개발에 사용되는 아키텍처다. 구글은 NPAPI 기반 플러그인은 브라우저에서 영상과 음성을 지원하는 기반을 제공했지만 지금은 필요치 않은 기술이라고 지적했다. 지금은 오히려 충돌, 보안 사고, 복잡한 코드의 원인이라는 것이다. 구글은 표준 기반 웹 플랫폼이 NPAPI를 대체할 수 있을 것으로 보고 있다. Netscape Plugin Application Programming Interface (NPAPI) is a cross-platform plugin architecture used by many web browsers. It was first developed for Netscape browsers, starting with Netscape Navigator 2.0. A plugin declares that it handles certain content types (e.g. "audio/mp3"). When the browser encounters that content type it loads the associated plugin, sets aside space within the browser context for the plugin to render and then streams data to it. The plugin is then responsible for rendering the data. The plugin runs in-place within the page, as opposed to older browsers that had to launch an external application to handle unknown content types. The API requires each plugin to implement and expose approximately 15 functions for initializing, creating, destroying and positioning plugin content. The NPAPI also supports scripting, printing, full screen plugins, windowless plugins and content streaming. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
29
Launching procedure wrt-launchpad to preload WebKit and WRT libraries
IPC is implemented based on unix domain sockets Every application created with AUL will create a sever socket and polling on this socket The incoming commands including: START, START_RES, OPEN, RESUME, TERM, RESULT, CANCEL, KEY_EVENT and etc. AMD; AUL(Tizen Application Utility Library) manager daemon AMD will work as a dispatcher to launch application and forward the bundle package Ewk: EFL Webkit Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
30
WRT – Lifecycle Source: Ming Jin , Tizen Web Runtime. Tizen Developer Conference 2012.
31
WRT – Lifecycle Suspend / Resume
By default, webviews will be suspended by WRT when the Web App goes to background, unless the developer explicitly enables it via <tizen:setting> Suspended activities include: JavaScript executions, timers, animations Even if a webview is not suspended in background, the painting operations will not happen in background and the backing store will be purged When switched to foreground, the suspended webviews will be resumed suspend JavaScript execution and rendering(including CSS animations) when app enters invisible state resume execution and rendering when app enters visible state do not suspend execution when background mode is enabled Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
32
Support system language change
Folder-based localization Web App contents can be localized in file unit according to W3C Widget P&C specification The localization requires page reloading, and the localized contents will only be reflected at next launching time Element-based localization Configuration document can be localized with xml:lang attribute Content-based localization System locale change event can be listened with Tizen System Info API L10n routine needs to be implemented in locale change event handler 국제화와 현지화는 출판물이나 하드웨어 또는소프트웨어 등의 제품을 언어 및 문화권 등이 다른 여러 환경에 대해 사용할 수 있도록 지원하는 것을 의미한다. 국제화(internationalization)를 I18N이나 i18n으로, 현지화(localization)를 L10N이나 l10n 등으로 표기하기도 한다. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
33
Resource Encryption / Decryption
Resources are encrypted during installation / update Enabled with <tizen:setting encryption=“enable”/> in config.xml Web App directory is scanned recursively Only resources with predefined extensions (html / js / css) are encrypted Information about encrypted resources are stored in WRT DB Resources are decrypted at runtime UI Process informs Bundle (WebProcess) about the decryption necessity Resources are decrypted to base64 string and read by WebKit Bundle performs resource decryption in willSendRequestForFrameCallback Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
34
Resource Encryption / Decryption
Resource Encryption at Install / Update Time Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
35
Resource Encryption / Decryption
Resource Decryption at Loading Time Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
36
Web Dynamic box support
WRT install WDB at the time when its Web app is installed (WDB resources are packaged with its Web app) On uninstallation, WDB resources are removed with its Web app Supported sizes: 1x1, 2x1, 2x2 Supports periodic update Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
37
Process sandboxing Web app (UI/Web process) sandboxing
UID: “app” GUID: “app” Process smack label: {PkgID} Resource smack label: {PkgID} Smack rules: basic application rules + privilege specific rules Web app private data (e.g., localstorage, indexed db, cookie, etc.) is protected from the rest of system after sandboxing [subjectLabel] [objectLabel] [access(rwxa)] Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
38
Privilege-based API security
A predefined collection of privileged APIs that can be assigned to the application to allow it to call the privileged APIs Ex. Privilege level A defined access level for the APIs, based on their influence Public Alarm, application, bluetooth, calendar, call history, contact, file system, message port, messaging, power, push, setting, system, etc. Partner App manager, secure element, system manager, etc. Platform Bluetooth manager, lock manager, package manager, setting manager, etc. Source: Ming Jin , Tizen Web Runtime Update. Tizen Developer Conference 2013.
39
Privileges
40
Privilege-based API security
Access Control enforcements Tizen WRT supports Tizen WebApps and multiple APIs: W3C APIs, and non-W3C APIs like WebGL and Tizen Web API WRT has a multi-process model WebKit based Widget instances are executed in separate processes Provides runtime isolation and allows the system to enforce custom process-level containment (sandbox) on each instance Two levels of access control enforcements WRT Access Control Engine(ACE): Fine-grained access control on JS APIs Application Sandbox via SMACK: Process-level containment by the kernel on system calls Source: Onur Aciicmez , Understanding the Permission and Access Control Model for Tizen Application Sandboxing. Tizen Developer Conference 2012.
41
Privilege-based API security
Access control model A subset of the JavaScript APIs supported in Tizen are considered restricted Restricted refers to any JS function that can access the private data on a device such as location, contacts, calendar, etc. Widgets need authorization to invoke restricted APIs Permission declarations and authorization: Declaration in manifest file: <feature> element for device APIs <access> element for network resources Authorization: prompt type decision according to WRT ACE policy user confirmations Source: Onur Aciicmez , Understanding the Permission and Access Control Model for Tizen Application Sandboxing. Tizen Developer Conference 2012.
42
Privilege-based API security
Access Control Engine Component responsible for Tizen policy management Evaluates policy per single request Manages policy and prompt verdict cache <feature name= required=“true”/> Source: Ming Jin , Tizen Web Runtime. Tizen Developer Conference 2012.
43
Access Control Enforcements
ACE policy Evaluation PEP (Policy Enforcement Point) : ACE interface for WRT PIP (Policy Information Point): Responsible for obtaining attribute values from WRT, Resource Information and OS PDP (Policy Decision Point): evaluates policies; Interacts with the user if necessary Policy Translator: Parses policies (XML) Verdict Manager: Responsible for caching the verdicts Source: Onur Aciicmez , Understanding the Permission and Access Control Model for Tizen Application Sandboxing. Tizen Developer Conference 2012.
44
Access Control Enforcements
Process Sandbox via SMACK The SMACK Policy File is updated with the appropriate rules during the install, update, or uninstall operations, as well as at run-time Rules are based on device features (manifest file), user confirmations, and security files (label, permissions for each feature) Widget requests access to a device feature ACE System Return result to WRT Access is made to a device feature Linux Kernel SMACK LSM Check access rights in the SMACK Policy File Widget requests access to a device feature ACE System Return result to WRT Access is made to a device feature Intercept system calls with SMACK Linux Kernel SMACK LSM Check access rights in the SMACK Policy File Source: Onur Aciicmez , Understanding the Permission and Access Control Model for Tizen Application Sandboxing. Tizen Developer Conference 2012.
45
Tizen Web API
46
Web API support W3C API The Device API
implements web standards relating to DOM, styles, device, graphics, media, communication, storage, security, UI, performance, location, and widget The Device API provides advanced logic employing sensors, file I/O, capturing, telephony, FM radio, speech recognition, HDMI output, and more W3C standard Web APIs W3C/HTML5 markup, CSS, and JavaScript APIs Supplementary APIs De-facto APIs (such as Khronos and Mozilla) Tizen Device APIs Advanced access to the device's platform capabilities UI framework jQueryMobile-based Tools, such as widgets, events, effects, and animations Standard HTML5 + Tizen device API + supplementary API Standard HTML5 plus tizen device extention and widely used supplementary APIs To provide as many APIs as possible to stadardize W3C API Tizen device extention to support various devices such as bluetooth and power control Not to forking W3C but try to standardize API. For example, there are working group in W3C to standardize device API Becase, W3C is mature but there is lack of device and security Web framework provides more functions Source: Tizen Overview and Architecture, Seokjae Jeong, Korea Linux Forum
47
Why Tizen Web Device APIs?
Limitations of standard specifications Most of them are still working drafts No full support for the Tizen characteristic features Tizen Web device APIs Device APIs give the characteristic features of the Tizen platform Device APIs have been updated agilely Source: Tizen – Universal Device Platform, Wonseok Lee, Samsung Electronics.
48
Tizen Web Device APIs Design
Follows W3C specification API style Numerical constants avoided but string enumerations used Most methods are asynchronous Success and error callback, and constructors used Based on standard technologies Tizen Web device API specifications are written in WebIDL Implementation follows the fundamental rule of ECMAScript 5.1 and W3C WebIDL recommendation (for example, type conversion) Defined tizen namespace All Tizen device APIs exist in the tizen namespace tizen is the global object to which all Tizen device APIs are bound Source: Tizen – Universal Device Platform, Wonseok Lee, Samsung Electronics.
49
Tizen Web Device APIs Design
Defined tizen namespace Source: Tizen – Universal Device Platform, Wonseok Lee, Samsung Electronics.
50
Tizen Web Device API Modules
Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
51
Tizen APIs (1/2) Tizen Provides Tizen’s common functionalities
Contains object interfaces that are commonly used throughout the other modules The tizen object is the topmost object providing the foundations for accessing Tizen device features Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
52
Tizen APIs (2/2) Tizen’s common object interfaces
Generic asynchronous callback handling Success callback for methods that do not require a return value Error callback for methods that require an error as input parameter Generic error and exception handling Tizen APIs throw a WebAPIException object and returns a WebAPIError object through error callbacks These follow the style and types of error of DOM4 specification. Filters and sort modes Filters are used to limit query results and compose complex queries Generally, filters are used with the find() method in Calendar, Call History, Contact, Content, and Messaging modules // Create an attribute filter based on first name: "First name should contain 'Chris' (case insensitive)" var filter = new tizen.AttributeFilter("name.firstName", "CONTAINS", "Chris"); // Sort by first name, ascending var sortMode = new tizen.SortMode("name.firstName", "ASC"); // Send request on contact address book. tizen.contact.getDefaultAddressBook().find(successCallback, errorCallback, filter, sortMode); Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
53
Application APIs (1/2) Alarm
Schedules an application to be launched at a specific time Application Manages current application (this application) Manages other applications Retrieves information of applications Launches other applications Application control /* Alarm is triggered at 8:00 on April 4, 2012 */ var date = new Date(2012, 3, 4, 8, 0); var alarm1 = new tizen.AlarmAbsolute(date); /* Alarm is triggered in 3 hours */ var alarm2 = new tizen.AlarmRelative(3 * tizen.alarm.PERIOD_HOUR); var appControl = new tizen.ApplicationControl(" null, "image/*", null, null); tizen.application.launchAppControl(appControl, null, successCb, errCb, null); Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
54
Application APIs (2/2) Package Data Control
Retrieves information of installed packages Checks the updates of the installed package list Installs or uninstalls packages partner privileged Data Control Exchanges specific data with the data control provider application Data control provider application can be implemented as a native application Data control types: SqlDataControl SQL-type data control – data consists of rows and columns MapDataControl key-value-type data control Package is a piece of applications that the system can install and uninstall, such as wgt, tpk, or rpm Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
55
Communication APIs (1/2)
Bluetooth Manages Bluetooth devices Discovers nearby devices, and bonds or pairs with found devices Connects to devices to exchange data with them NFC Manages NFC devices Detects NFC tag and peer Exchanges NDEF data Messaging Sends or receives SMS, MMS, or messages Retrieves the message storage var nfcAdapter = tizen.nfc.getDefaultAdapter(); nfcAdapter.setPowered(true, onPowerOn, onPowerOnFails); Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
56
Communication APIs (2/2)
Network Bearer Selection Sets a network bearer for a specific IP address or domain name partner privileged Secure Element Provides functionality to communicate with applications in several secure elements, such as UICC/SIM, embedded Secure Element, or Secure SD card Push Receives push notifications from the Tizen push server Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
57
Content APIs (1/2) Content
Discovers and manages images, video, music, and other files Scans content or directory metadata in the device and updates the content database Retrieves content from content database using filters Browses content by getting a list of content directories Views and edits content item details Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
58
Content APIs (2/2) Download Downloads files from a specific URL
Enables applications to manage download operation details Sets the stored location of a downloaded file Sets the network type: cellular, Wi-Fi, or default Get operation status: current received size and events Gets the file MIME type Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
59
Input/Output APIs Filesystem
Accesses the file system virtual root locations Documents, downloads, images, music, videos, ringtones, wgt-package, wgt-private, and wgt-private-tmp Manages file storage Internal and external Mounted, removed, or unmountable Accesses files and directories Creates, reads, edits or deletes files and directories Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
60
Input/Output APIs Message Port
Communicates with other applications: IPC based on application ID
61
Social APIs (1/3) Contact Manages contacts in device address books
Including adding, searching, updating, and deleting Manages persons Person is the aggregation of one or more contacts that are the information of the same person Supports vCard 3.0 Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
62
Social APIs (2/3) Calendar Call History Manages events and tasks
Including adding, searching, updating, and deleting Each event or task has a series of attributes, such as purpose, starting time, and duration Monitors the changes in events and tasks Supports iCalendar v2.0, based on RFC 5545 Call History Browses the call history of a device Removes call history entries Monitors changes Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
63
Social APIs (3/3) Bookmark Data Synchronization
Manages bookmarks and bookmark folders Browses bookmark folders platform privileged Data Synchronization Synchronizes device data to the server using the OMA DS(Data Synchronization) 1.2 protocol Contact data or calendar data Manages the OMS DS profile slots Tizen platform sets a limitation on the number of supported profiles Adds, updates and removes profiles Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
64
System APIs (1/2) Time System Information
Provides TZDate type that is an extended type of ECMAScript date It contains the time zone information as well as time information Provides utility functions for managing system time and duration Methods for getting local time or time zone Methods for calculating time duration System Information Enables access various properties of the system Bluetooth, NFC, Wi-Fi, Front/back Camera, Flash, GPS, Sensors, Platform and API version, USB host/accessory Monitors the change of system information Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
65
System APIs (2/2) System Setting Power
Sets or gets the system setting values HOME_SCREEN: Home screen background image LOCK_SCREEN: Lock screen background image INCOMING_CALL: incoming call ringtone NOTIFICATION_ notification alert tone Power Manages the power state for the screen resource Sets or gets the state of the screen: off, dim, normal, or bright Monitors the changes in the state of the screen Sets the CPU not to sleep Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
66
User Interface APIs Notification
Posts UI notifications about application events Source: Kisub Song , Tizen Web Device API. Tizen Developer Conference 2013.
67
Crosswalk New Web Runtime (tizen 3.0) https://crosswalk-project.org/
Web, Multimedia, Device APIs open source, released under a BSD licence. founded by Intel's Open Source Technology Center. Blink rendering and layout engine Designed for Tizen but also for Android Backwards compatible with Tizen 2.x WRT Cordova Device APIs
68
Crosswalk Architecture - Modules
69
Crosswalk Architecture - Runtime
Shared process model BP is shared with all WebApps WebApp contains EP and RP RP is sandboxed and can’t do OS calls RP delegates OS calls to BP via IPC EP is not sandboxed and can do OS calls
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.