21
Developing Portable Tizen Apps Companion to Tizen Application Portability and JavaScripting Tizen Web Apps Michael Schloh von Bennewitz 28. April 2013, Version 0.93

Developing Portable Tizen Apps - DZone: …€œportizapps” — 2013/4/28 — 0:38 — page i — #1 Developing Portable Tizen Apps Companion to Tizen Application Portability and

Embed Size (px)

Citation preview

ii

“portizapps” — 2013/4/28 — 0:38 — page i — #1 ii

ii

ii

Developing Portable Tizen Apps

Companion to Tizen Application Portabilityand JavaScripting Tizen Web AppsMichael Schloh von Bennewitz28. April 2013, Version 0.93

ii

“portizapps” — 2013/4/28 — 0:38 — page ii — #2 ii

ii

ii

This text originates from Tizen research undertaken by the author and associates. It attempts to explainemerging technology in a changing state. If updates of the information in this article become necessary, theywill be posted on the web sites:

http://mobile.dzone.com/articles/devportizapps/http://css.dzone.com/articles/devportizapps/

Copyright c©2013 Michael Schloh von BennewitzAll rights reserved

Published by DZone, Incorporated150 Preston Executive, Suite 201Cary, North Carolina 27513United States of America

ii

“portizapps” — 2013/4/28 — 0:38 — page iii — #3 ii

ii

ii

Contents

1 Introducing Tizen 1

1.1 Motivation behind portable development . . . . . . . . . . . . . . . . . . . . . . 1

1.2 The world wide soup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Tizen Architecture 3

2.1 Vendors and device segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Web Runtime and Web Framework . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3 WebKit adoption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 GNU/Linux and sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 JavaScript Libraries 5

3.1 JQuery Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.2 Sencha Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.3 Dojo Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.4 Enyo JS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.5 HTML5 Boilerplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.6 Native-to-JavaScript bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.7 Package standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.8 Store deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Tizen Development Tools 10

4.1 Tizen integrated development environment . . . . . . . . . . . . . . . . . . . . . 10

4.2 Tizen emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4.3 Tizen simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Summary 12

5.1 Benefits of portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Works Cited 13

iii

ii

“portizapps” — 2013/4/28 — 0:38 — page iv — #4 ii

ii

ii

List of Figures

1 W3C and other standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Tizen layered architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3 Browser and Web Runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4 JavaScript library screen shots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

5 Divergence of rich and reach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

6 Web app installation structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

7 Web app file system layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

8 Tizen SDK icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

9 Eclipse-based IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

10 Ripple-based WRT simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

11 Dynamic performance analyser . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

12 Samsung made Tizen device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

iv

ii

“portizapps” — 2013/4/28 — 0:38 — page v — #5 ii

ii

ii

Source Code Listings

1 Declarative programming with jQuery Mobile and multi page encapsulation . . . 5

2 A complete Sencha Touch index.html, suitable even for large projects . . . . . . 6

3 Implementation of the entry point to a Sencha Touch app . . . . . . . . . . . . . 6

4 A small Dojo Mobile app implemented completely in index.html . . . . . . . . . 7

5 A small Enyo JS app implemented completely in index.html . . . . . . . . . . . 8

v

ii

“portizapps” — 2013/4/28 — 0:38 — page vi — #6 ii

ii

ii

Abstract

This article complements the online lecture series delivered at the annual Tizen Developer Confer-ence and elsewhere. Titled “JavaScripting Tizen Web Apps” and “Tizen Application Portability”,these lectures serve to guide developers interested in Tizen and the benefits of portable developmentstrategies.

An analysis of the availabile Tizen APIs begins with consideration of standards and portable webtechnologies. The Tizen architecture is reviewed, and contrasting its Web and Native Frameworksleads to a inspection of Tizen’s deployment approach and how it affects web logic and content of bothserver-based and locally installed apps.

While evaluating strategies to leverage JavaScript libraries, a number of popular candidates are pre-sented. Attention is given to the Web Framework embedded version of jQuery Mobile as well as thirdparty alternatives like Sencha Touch, Dojo Mobile, and Enyo JS. Along with a short explanation ofnative-to-javascript bridges and their potential in portably employing the Tizen Device API, codesamples illustrate the utility of popular JavaScript libraries.

vi

ii

“portizapps” — 2013/4/28 — 0:38 — page 1 — #7 ii

ii

ii

1 Introducing Tizen

As far as mobile-optimized operating systems are concerned, Tizen[Tiz13c] is certainly a new player. This unique platform enjoying a partner-ship between Samsung, Intel, and the Linux Foundation intends to soonpower a wealth of devices. According to Samsung, “We plan to releasenew, competitive Tizen devices within this year and will keep expandingthe lineup depending on market conditions.” [Lee13] As the Tizen OS andAPIs mature one thing is clear. Tizen architects are putting the conceptof portable applications built on standard technologies first and foremost.

In this article we’ll cover the basics of how Tizen APIs support development of portable apps.Regardless of whether the developer uses the official Tizen software development kit (SDK)or other development tools, apps written for Tizen’s Web Framework [Sax12a] [Tiz13a] canbe ported to other platforms leveraging web standards relatively easily. Being an emergingtechnology Tizen stands to benefit even more from the porting of pre existing web apps [WH13].

1.1 Motivation behind portable development

While developers and users alike profit from apps that work on a variety of operating systems,it’s interesting that those most influencing Tizen’s architecture value its portable nature inrespect to the diverging user experiences coming in future Tizen devices. Sunil Saxena states“the emphasis for Tizen architecture is WebAPI to ensure applications work across different ar-chitectures and different profiles,” [Sax12b] meaning that a low power navigation computer willexecute and display a geographical app just as well as a higher power notebook or tablet com-puter would. Portable APIs empower software reuse as well, which can drive down expensiveengineering costs considerably.

While considering the wealth of Tizen platform support for portable develop-ment it’s important to remember that Tizen provides non standard yet valuableinfrastructure as well. Goodies lie between the sandwich of POSIX-friendlyGNU/Linux kernel and Tizen frameworks. Namely, rather than Qt or Gtkthe Enlightenment Foundation Libraries (EFL) provides Tizen with widgetsand supporting graphical building blocks. Although EFL-linked apps build on

Unix-like kernels using portable and standard ISO C, it’s not reasonable to expect them towork on Windows Phone, iOS, or the Qnx-based Blackberry 10 to name a few. In this articlewe narrow the definition of portable application development to focus our attention on webtechnologies like JavaScript, CSS, and HTML.

1

ii

“portizapps” — 2013/4/28 — 0:38 — page 2 — #8 ii

ii

ii

1.2 The world wide soup

Hyper buzzwords aside, most developers of modern web apps appreciate the richfeature set provided by the recent advancements in HTML5, CSS3, JavaScript,as well as related web technologies like XMLHttpRequest (XHR) or the varietyof JavaScript libraries [SvB12]. In fact web interfaces are so often mixed thatmany refer to this new web soup as simply being composed of ‘HTML5’, notto mention that HTML5 is a emerging standard in itself.

Figure 1: Regards tostandards, W3C TSL

Standardized interfaces and implementations like HTML have acceler-ated the adoption of web technologies which has in turn strengthenedthe very standards (W3C, ECMA, IETC, ISO) that foster portability.Meanwhile, development communities have overtaken the pace of stan-dards production which has given rise to a number of databases andutilities useful for evaluating standards compliance, API adoption, andgeneral compatibility of web technologies. Some examples include:

� http://www.html5test.com/

� http://www.html5please.com/

� http://www.modernizr.com/

� http://www.caniuse.com/

� http://www.fmbip.com/litmus/

� http://www.markus-falk.com

/mobile-frameworks-comparison-chart/

2

ii

“portizapps” — 2013/4/28 — 0:38 — page 3 — #9 ii

ii

ii

2 Tizen Architecture

The Tizen work group’s stated objective in designing the kernel, core, framework, and appli-cation layers involves leveraging “HTML5’s robust capabilities and cross platform flexibility”to empower developers of portable applications. “The Tizen SDK and API allows developersto use HTML5 and related web technologies to write applications that run across multiple de-vice segments, including smartphone, tablet, smart TV, in-vehicle infotainment, and netbook.”[Wor12]

Figure 2: Architecture of the Tizen SDK 2.0, CC Attribution 3.0 Unported

2.1 Vendors and device segments

The construction of Tizen differs from one device segment to the next. Vendors can takeadvantage of the open nature of Tizen’s development cycle to modify the OS to suit theirneeds, and several key system components deviate to demonstrate this [Cla12]. For example,Tizen’s official IVI image profile distributes the Qt library alongside EFL. Each finished Tizenimage aggregates software packaged in the RPM format corresponding to a specific architecture(like IA32 or ARMv71) and device segment.

What unifies these Tizen variants is the fact that their component diagrams are arranged likea sandwich, with applications resting on the framework layer which in turn lies on the core.Each layer is a collection of components in itself, and even the core consists of the Linux kernel,device drivers, and a variety of low level APIs and subsystems.

3

ii

“portizapps” — 2013/4/28 — 0:38 — page 4 — #10 ii

ii

ii

2.2 Web Runtime and Web Framework

Figure 3: Similarity between the Tizen Browser andWeb Runtime, GNU Free Documentation License 1.3

One of the most important compo-nents is the Tizen Web Runtime, thecomponent that allows web apps torun outside the browser. Tizen userscan install and use web apps as if theywere standalone applications, and theWeb Runtime manages the life cy-cle, system calls, execution, resources,platform integration, and access con-trol of the web app [Jin12] [Mee11].

Similarly named, the Web Frameworkaggregates the Web Runtime alongwith the W3C API, Device API, and aUI framework containing widgets de-rived from jQuery Mobile.

By exposing the standard W3C and unique Device APIs, Tizen offers added value to web appsthat could otherwise only render HTML and carry out generic JavaScript. The Tizen W3C APIimplements web standards relating to DOM, styles, device, graphics, media, communication,storage, security, UI, performance, location, and widget. The Device API provides advancedlogic employing sensors, file I/O, capturing, telephony, FM radio, speech recognition, HDMIoutput, and more.

2.3 WebKit adoption

To render web content the Tizen Web Runtime employs the WebKit layoutengine in a similar fashion as Android, Chrome, Safari, MeeGo, Qt, and anumber of other WebKit dependent projects. A consideration when choosinga JavaScript library (see section) is indication of WebKit support as well assupport for whichever engine the developed software should be portable on.

2.4 GNU/Linux and sources

Rather than blurring the lines of free license by releasing binary blobs of kernel and libc whilepublishing only sanitizing header files, Tizen’s GNU/Linux kernel and other sources are com-plete, online, and publicly accessible. Any developer can pull a copy of these sources and buildtheir own Tizen image [Tiz13d] ready for installation to hardware. After installed, Tizen isbootstrapped by the U-Boot boot loader as with many low power or embedded systems.

4

ii

“portizapps” — 2013/4/28 — 0:38 — page 5 — #11 ii

ii

ii

3 JavaScript Libraries

To maximize portability we focus on the model of Tizen development dependent on a webframework. It’s this model that minimizes system dependencies and empowers development offar ‘reach’ in apps.

Although the Tizen Web Framework incorporates a custom themed JQuery Mobile installation,the competing web frameworks aren’t only useful for porting existing applications. Rather,they’re perfect for original Tizen development as well when leveraging the skill set of a developeralready familiar with Dojo, requiring the complex fine tuned JavaScript manipulation for whichSencha Touch is known for, or just reusing code written in a pre dating JavaScript library likeEnyo JS.

Figure 4: Praiseworthy cross-platform portability of installable Tizen web apps, GFDL 1.3

3.1 JQuery Mobile

This is one of few libraries that support more than WebKit rendering. In fact, jQuery Mobilesupports the WebKit, Gecko (Mozilla), Presto (Opera), and Trident (Microsoft) engines aswell. With such attention to compatibility it’s no surprise that Tizen already enjoys A-gradesupport, with a fully enhanced experience and Asynchronous JavaScript and XML (AJAX)based animated page transitions [jQu13]. This compatibility factor is an advantage whendeveloping Tizen web apps to be portable with Mozilla’s Firefox OS or Microsoft’s WindowsPhone.

Listing 1: Declarative programming with jQuery Mobile and multi page encapsulation

1 <head>2 <link rel="stylesheet"3 href="//code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.css" />4 <script src="//code.jquery.com/jquery-1.8.2.js"></script>5 <script src="//code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.js"></script>6 <body>7 <div data-role="page" id="firstpage">8 <div data-role="header">9 <h1>Nice header</h1>

10 </div>11 <div data-role="content">

5

ii

“portizapps” — 2013/4/28 — 0:38 — page 6 — #12 ii

ii

ii

12 <p>I’m the first page. Click for <a href="#secondpage">Second page</a></p>13 </div>14 </div>15 <div data-role="page" id="secondpage">16 <div data-role="content">17 <p>I’m the second page. Click for <a href="#firstpage">First page</a></p>18 </div>19 </div>20 </body>

jQuery Mobile’s most unique features is its accommodation of the declarative programmingparadigm to best suite those familiar with static web pages. It ingeniously rearranges theDOM when parsing static HTML and avoids page HTTP round trips and page refreshes withoutdeveloper intervention.

3.2 Sencha Touch

This popular JavaScript library differs from declarative alternatives in that its structural natureworks almost exclusively with JavaScript. Typical with Sencha Touch apps, the directory index(index.html) looks empty and really just serves as a boot loader to the JavaScript logic thatin turn builds the document object model (DOM) dynamically. The user’s browser windowlayout is constructed by supplying the Sencha Touch library with JavaScript code and JSONdata that the library uses in deciding how to construct the ‘view.’ This elegant approach hasits advantages, but involves a steeper learning curve than jQuery Mobile.

Listing 2: A complete Sencha Touch index.html, suitable even for large projects

1 <!DOCTYPE html>2 <html>3 <head>4 <title>Simple Sencha</title>5 <link rel="stylesheet" href="//cdn.sencha.com/touch/sencha-touch-2.1.1/6 resources/css/sencha-touch.css" />7 <script src="//cdn.sencha.com/touch/sencha-touch-2.1.1/sencha-touch.js"></script>8 <script src="app.js"></script>9 </head>

10 <body>11 <!-- Nothing here! -->12 </body>13 </html>

The entry point of web apps built with Sencha is a handler for the launch (not lunch!) eventfired by Sencha logic when the library is loaded. A lot of ‘Ext’ keywords in this and other codereveal that this architecture evolved from the historically significant Sencha ExtJS library.

Listing 3: Implementation of the entry point to a Sencha Touch app

1 Ext.application({2 launch: function() {3 alert(’App launched!’);4 }5 });

6

ii

“portizapps” — 2013/4/28 — 0:38 — page 7 — #13 ii

ii

ii

Recent developments in Sencha Touch have led to a important release commonly referred toby its main version 2 [Sen13]. A number of additions were made, including some native-to-JavaScript (see section) bridging on iOS and Android as well as a build infrastructure toproduce the corresponding native packages. This is all quite useless to Tizen unfortunately,unless Sencha moves beyond their Android/iOS centric support model.

3.3 Dojo Mobile

The Dojo Mobile library is similar to jQuery Mobile in that its cutting edge mobile and touchspecific logic extends the mature core of the JavaScript Dojo Toolkit library. It allows thedeveloper to program the DOM declaratively by parsing simple HTML and automaticallymarshals page data over XHR similar to jQuery Mobile to perform smooth page transitions andeffects, but Dojo Mobile is unique for providing a modular loading mechanism and distributingits JavaScript library bundled in modules which implement Dojo APIs responsible for dataabstraction and DOM manipulation. It incorporates internationalization (i18n) components bydesign and offers a lot in terms of abstraction of data from control flow. Dojo Mobile best suitsiOS, Android, and Blackberry for their look and feel, but its widget theme adaptation is flexibleenough to put Dojo Mobile on par with the other competing portable JavaScript libraries forTizen web app development as well.

Listing 4: A small Dojo Mobile app implemented completely in index.html

1 <!DOCTYPE html>2 <html>3 <head>4 <title>Our Dojo Test</title>5 <script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js"></script>6 <script>7 require(["dojox/mobile/parser", "dojox/mobile", "dojox/mobile/deviceTheme"],8 function(parser) {9 parser.parse();

10 });11 </script>12 </head>13 <body>14 <div id="settings" data-dojo-type="dojox.mobile.View">15 <h1 data-dojo-type="dojox.mobile.Heading">Tizen App with Dojo Mobile</h1>16 </div>17 </body>18 </html>

3.4 Enyo JS

At the heart of Enyo JS is a simple but powerful encapsulation model, which helps to factorapplication functionality into self-contained building blocks that are easy to reuse and maintain[Eny12]. One of the appealing factors of this library is its widespread use in plentiful web appsboth new and old. Enyo certainly profited from wide distribution of the Linux-based WebOSwith the historical Palm and HP devices, in which Enyo was used as the primary web framework.

7

ii

“portizapps” — 2013/4/28 — 0:38 — page 8 — #14 ii

ii

ii

Listing 5: A small Enyo JS app implemented completely in index.html

1 <!DOCTYPE html>2 <html>3 <head>4 <title>Our Enyo Test</title>5 <link rel="stylesheet" href="//enyojs.com/enyo-2.2.0/enyo.css" />6 <script src="//enyojs.com/enyo-2.2.0/enyo.js"></script>7 </head>8 <body>9 <script>

10 new enyo.Control({content: "Hello From Enyo"}).renderInto(document.body);11 </script>12 </body>13 </html>

3.5 HTML5 Boilerplate

Although the Tizen IDE template for HTML5 Boilerplate projects was removed in the SDK 2.0release, HTML5 Boilerplate still deserves attention for the utility it provides and broad followingamong developers. The HTML5 Boilerplate deliverables can be easily merged with any of theweb app project templates in the Tizen IDE, and when used wisely, it accelerates developmentof logic common to the early stages of most web apps. Of particular interest in HTML5Boilerplate is provision of ‘Modernizr’ browser detection and ‘Normalize’ CSS consistency logic.Other boilerplate files relate to Apache, custom 404 pages, cross-domain, robot indicators, andicons.

3.6 Native-to-JavaScript bridges

Figure 5: Divergence of rich and reachin mobile apps, GFDL 1.3

Certain Tizen APIs (even in the Web Framework) fea-ture entry points to unportable constructs responsi-ble for components such as time, settings, connec-tion, contacts, device, file, media, notification, stor-age, events, camera, and capture. Employing any ofthese APIs reduces portability of the application inquestion. To regain lost cross platform portability, it’sgood to know about projects implementing native-to-JavaScript bridge technology for hybrid apps.

Apache Cordova supports most APIs from the outdated Tizen SDK 1.0 release[PY12]. This portability framework exposes a set of JavaScript APIs thatallow a developer to access native device functions like camera manipulationor accelerometer inspection. Combined with a UI framework such as jQueryMobile, Dojo Mobile, or Sencha Touch, this allows a smartphone app to bedeveloped with just HTML, CSS, and JavaScript [The12].

There’s not many other competing hybrid JavaScript frameworks, but the ‘Titanium’ brandedtools by Appcelerator are being ported [Mus13] to support Tizen APIs.

8

ii

“portizapps” — 2013/4/28 — 0:38 — page 9 — #15 ii

ii

ii

3.7 Package standard

Tizen web apps are packaged [Shi12] according to the W3C widget packaging specification[Gro13], just as the Wholesale Applications Community (WAC) mandated.

Figure 6: Example installation structure of a web app file, GFDL 1.3

File boat.wgt:

index.htmlconfig.xmlicon.pngboat/

scripts/engine.js

styles/main.css

images/header.png

locales/en-gb/

boat/images/

hearder.png

Figure 7: Corresponding file system layout for example web app ‘boat.wgt’, GFDL 1.3

3.8 Store deployment

Nevertheless, packages are only part of the deployment strategy. Af-ter much speculation the official Tizen Store was mentioned duringthe Mobile World Congress 2013 [M13], but without details of in-frastructure nor APIs. Since there’s been no official release of thistechnology, for the time being packages must be consumed either inthe traditional way or by leveraging any of a number of competingyet compatible third party web app servers providing a store-like ex-perience:

� 5Apps� AppUp

� NeXva� AppsFuel

� HTML5 Ninja� BoosterMedia

9

ii

“portizapps” — 2013/4/28 — 0:38 — page 10 — #16 ii

ii

ii

4 Tizen Development Tools

The Tizen SDK is a comprehensive set of tools for developing Web applications, native ap-plications, and the platform component for Tizen. It contains an install manager, IDE, tools,documents, samples, and a platform image [Tiz13d]. Once installed, its logical file hierarchyincludes: ide, install-manager, library, platforms, and tools.

Figure 8: GUI tools distributed in the Tizen SDK 2.0, GNU Free Documentation License 1.3

4.1 Tizen integrated development environment

The Tizen integrated development environment (IDE) is a Eclipse derived program, so it re-quires a Java runtime to work. Because the Eclipse core provides so much customization andleverages Java APIs to do this, there are special requirements involved. Contrary to the the-oretically portable nature of Java, problems arise when using OpenJDK and other alternativeJava environments. Particularly, Oracle’s Java v6 JDK (not JRE) or later is required [Tiz13b].

Figure 9: The Tizen SDK 2.0 Eclipse-based IDE, GFDL 1.3

Regardless of the installationrequirements, developers of theTizen SDK have chosen wiselyin deriving from the EclipseIDE. It provides plugin infras-tructure to support a comfort-able method of generating cer-tificates, event injection, vali-dating code, packaging applica-tions, and more.

Other important Tizen SDKdeliverables include the Tizenemulator and simulator. Whilethese tools differ internally,they perform similar duties in imitating the run time behavior of the operating system.

4.2 Tizen emulator

The Tizen emulator uses the QEMU machine emulator and virtualizer to provide the developerwith an fully hardware and GPU (GLES) accelerated environment when the host system (withKVM or HAX) and hardware supports it. A number of convenient options appear once theemulator runs to enable screen rotation and scaling, screen shot manipulation, host keyboardinput capturing, ram dump diagnosis, and shell access. The emulator can additionally field

10

ii

“portizapps” — 2013/4/28 — 0:38 — page 11 — #17 ii

ii

ii

system events (battery, ear jack, USB, received signal strength indication, SD card, geolocation,NFC, accelerometer, voice and text telephony, light, motion, and proximity sensors) injectedby the Tizen IDE or SDB (described below) for a high degree of extensive testing.

4.3 Tizen simulator

Figure 10: The Tizen SDK 2.0 WRT Simulator,GNU Free Documentation License 1.3

Tizen SDK developers have released a spe-cial web-based test facility called the Tizensimulator. The simulator is not a indepen-dent piece of software however, but is rathera interesting blend of the Apache Ripple webruntime simulator already in use by groupslike Cordova, WAC, and WebWorks. Rip-ple isn’t a binary either. Instead, it is aweb app in itself that bootstraps by start-ing a web browser and loading standard weblogic. In order to mitigate problems withXHR cross and null origin access, the Ti-zen simulator makes assumptions about theinstalled host web browser, requiring eitherGoogle Chromium or Chrome by hard cod-ing start up arguments like ‘allow-file-access-from-files’ and ‘disable-web-security.’

Concerning the Tizen emulator and simulator,release engineers have correctly named these tools in describing their emulating and simulatingnatures. It follows that the Tizen simulator includes no kernel of its own, exposes no APIs atall, and is useless for testing drivers, security, primitive graphics, and native development ofany kind. But before throwing away the piece, it’s important to know one thing. The Tizensimulator is priceless when testing web applications that benefit from a quick edit and testinterpretation cycle.

Figure 11: Performance bottlenecks diagnosed using the‘Dynamic Analyser’, GFDL 1.3

Packed into the Tizen SDK are a fewconvenience tools as well as perfor-mance boosting diagnosis tools. Ofparticular interest to software de-signers and graphical tool enthusi-asts are the ‘UI Builder’, ‘UI EffectBuilder’, and ‘Dynamic Analyser.’

11

ii

“portizapps” — 2013/4/28 — 0:38 — page 12 — #18 ii

ii

ii

5 Summary

While mobile strategy comparisons of web and native app development assume mutually exclu-sive APIs, Tizen provides a unique Web Framework serving elements of both worlds. Web appscan leverage this to benefit from feature complete and portable standards-based development.Learning the ropes of web app development for Tizen and other mobile platforms makes sensefor these reasons.

5.1 Benefits of portability

Figure 12: A Samsung made Ti-zen device presented at Mobile WorldCongress 2013[Seo13]

Devices on which Tizen runs have potential regardlessof mobile strategy and it’s likely that many will em-brace Tizen’s ability to support native development forgood reasons. Nevertheless, advancing both Tizen anddevelopers’ interests in a market of emerging technol-ogy by employing standard APIs as provided by Tizen’sWeb Framework can be favorable. If the Tizen applandscape is best served by both quality and variety,then developers should turn their attention to portabledevelopment of both original and existing (ported fromother platforms) web apps. Tizen’s architects have goneto lengths to allow low-level APIs to be leveraged fromweb apps. Developing portable Tizen apps using webtechnologies is both practical and effective.

12

ii

“portizapps” — 2013/4/28 — 0:38 — page 13 — #19 ii

ii

ii

Works Cited

[Cla12] Joel Clark. Qt/qml or efl in tizen ivi. http://lists.tizen.org/listinfo/ivi/,June 2012.

[Eny12] About enyo, core concepts. http://www.enyojs.com/about/, 2012.

[Gro13] Web Applications Working Group. Packaged web apps (widgets).http://www.w3.org/TR/widgets/, November 2013.

[Jin12] Ming Jin. Tizen web runtime. In Tizen Developer Conference, San Francisco,California, May 2012. http://www.tizen.org/events/tizen-developer-conference/2012/conference-schedule#session 180.

[jQu13] Mobile graded browser support. http://www.jquerymobile.com/gbs/, 2013.

[Lee13] Jungah Lee. Samsung to sell tizen-based handsets after motorola deal.Businessweek, January 2013. http://www.businessweek.com/news/2013-01-03/samsung-to-sell-tizen-based-handsets-after-google-motorola-deal/.

[Mee11] Sdk/docs/1.1/web sdk with wrt.http://wiki.meego.com/SDK/Docs/1.1/Web SDK with WRT, 2011.

[Mus13] Ingo Muschenetz. Titanium mobile tizen preview now available. Web log,Appcelerator Developer Blog, February 2013.

[M13] Mirko Mller. Tizens app-store erstmals gezeigt. Web log, Tizen Blog, March 2013.

[PY12] Ren Pourtier and Luc Yriarte. Enabling cordova on tizen. In Tizen DeveloperConference, San Francisco, California, May 2012. http://www.tizen.org/events/tizen-developer-conference/2012/conference-schedule#session 272.

[Sax12a] Sunil Saxena. Tizen architecture. In Tizen Developer Conference, San Francisco,California, May 2012. http://www.tizen.org/events/tizen-developer-conference/2012/conference-schedule#session 150.

[Sax12b] Sunil Saxena. Tizen architecture overview. In Linux Foundation CollaborationSummit, San Francisco, California, April 2012. https://www.tizen.org/events/2011/linux-foundation-collaboration-summit-2012/.

[Sen13] Accessing native apis with ext.device.http://docs.sencha.com/touch/2-1/#!/guide/native apis, February 2013.

[Seo13] Daniel Juyung Seo. Samsung rd-pq handset photo.http://pds27.egloos.com/pds/201303/28/58/a0004058 51531936eb6eb.jpg,March 2013.

[Shi12] Raghavendra Reddy Shiva. Tizen application packaging overview.http://developer.tizen.org/documentation/

tizen-application-packaging-overview/, December 2012.

13

ii

“portizapps” — 2013/4/28 — 0:38 — page 14 — #20 ii

ii

ii

[SvB12] Michael Schloh von Bennewitz. Tizen application portability. In Tizen DeveloperConference, San Francisco, California, May 2012. http://www.tizen.org/events/tizen-developer-conference/2012/conference-schedule#session 271.

[The12] About apache cordova. http://cordova.apache.org/, 2012.

[Tiz13a] Architecture of tizen. http://developer.tizen.org/help/topic/org.tizen.gettingstarted/html/tizen overview/tizen architecture.htm, 2013.

[Tiz13b] Prerequisites for the tizen sdk. http://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk/, February 2013.

[Tiz13c] Tizen. http://www.tizen.org/, March 2013.

[Tiz13d] Tizen 2.0 release notes.http://developer.tizen.org/downloads/sdk/2.0-release-notes/, February2013.

[WH13] Kevin Wang and Darren Hjung. Porting guide.http://wiki.tizen.org/wiki/Porting Guide, February 2013.

[Wor12] Tizen Workgroup. Tizen.http://www.linuxfoundation.org/collaborative-projects/tizen, 2012.

14

ii

“portizapps” — 2013/4/28 — 0:38 — page 15 — #21 ii

ii

ii

About the Author

Michael Schloh von Bennewitz is a computer scientist and expert on network software engi-neering. His repertoire includes development of Internet client software and network servers.Aside from undertaking research and development for, he has fulfilled localization assignmentsand consulted telecoms with intention to implement UMTS on mobile system design.

Michael is a founder of the OpenPKG Foundation as well as a contributor to several Open Sourceprojects like Scribus, OpenSIPS, and Tunnelblick (OpenVPN.) He documents technology trendsat the Electrotrends News Service and composes articles and books on a variety of topics.

Today, Michael consults for companies on design and implementation of network software, andlectures on mobile client technology as well as enterprise services. Fluent in four languages,Michael’s lectures are dynamic, humorous, and well adapted for both technical and non technicalaudiences. He is the director of Europalab Networks, a research facility and network operationscenter.

Additional information is found at http://michael.schloh.com/

About the Publisher

DZone produces and publishes valuable content for our global audience of software developersand architects. For 15 years, DZone has cultivated trust and earned credibility with our activeand engaged community by being honest, producing and sharing useful content where it willhave the greatest impact.

DZone’s resource portals feature a mix of daily news, articles, video interviews, tutorials, andreviews written by leading industry experts.

These resources and more are found at http://www.dzone.com/