SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
The Tizen Web Platform,
where web apps feels right at home
Kenneth Christiansen / Alexis Menard
Web Platform Architects
Intel Corporation

#SDC13
Agenda
Part 1: The runtime model
In this section, the Tizen Web Application model (aka Web Runtime) will be introduced
along with its major features.

Part 2: Creating an application
We will walk through the major steps for creating a simple application accessing
hardware capabilities

Part 3: Responsive design and good practices
Furthermore, we will look at good practices for adapting responsive design, allowing
the application to target future Tizen devices, using different resolutions, screen sizes
and interaction models
Part 1

The runtime model
What is Tizen
Tizen is new OS, backed by industry leaders
It is open and the focus is on web apps
It targets multiple devices, not just mobile phones

In many ways, it is ahead of its time with the focus on web and the extensions to
the web platform.
What is Tizen
Brilliant support for latest HTML5 specs
Great performance, good implementations, emerging standards:
• Vibrate
• Battery
• Screen lock
Not to forget device API’s currently being standardized in the W3C
Why betting on the web
Q: What is a web application?
Why HTML5 and the web platform:

•
•
•
•
•
•

Integration with existing cloud services
Most flexible layout engine
Reuse existing code and knowledge
Cross platform “promise”
Immediate update and distribution control (hosted apps)
Responsive design
Why betting on the web
Downsides

•
•
•
•
•
•

Timely access to new OS innovations
Offline support
Access to native capabilities
Control over the application (life cycle, launching, etc)
Store support
Interaction with the interface (viewport, orientation lock, touch control,…)

Tizen brings the promises of HTML5 and aims at closing the gaps to native
Timely access to new OS innovations
Tizen brings its own additional API’s

• These are optional (you should code as such) and only available on Tizen
• General purpose API’s are being standardized in the W3C together with
Mozilla, Intel, Samsung a.o.
Offline support
Packaged applications

•
•
•
•
•
•

Bundle HTML, CSS, other resources incl. manifest
Prepared for offline support
Based on the W3C Widgets specs
Localization support
Query manifest from applications
Permission control
Access to native capabilities
The additional Tizen API’s allows you to access a variety of things

• Bluetooth, Contacts, Callhistory, NFC, Local Filesystem, etc.
• Capabilities are controlled by permissions control similar to that of
Android apps
Control over the application
A variety of API’s available

•
•
•
•

Deal with discharging battery or control display (Power API)
Query manifest (widget.description, widget.version, etc.)
Launch application and receive result (App Control API)
Schedule tasks: Launch app at a given time (Alarm API)

// when the alarm is triggered the app is launched if not already running
var alarm = new tizen.AlarmAbsolute(new Data(2013, 10, 4, 8, 0));
tizen.alarm.add(alarm, “org.tizen.browser”);

Tizen.application.getCurrentApplication();
Interaction with the user interface
Great touch and mobile support

•
•
•
•

Touch interaction and touch events (web facing)
Screen Orientation Lock
Fullscreen support – per element
Viewport meta tag
Store support

Packaged apps can be distributed via the Tizen Store: http://seller.tizenstore.com
Part 2

Creating an application
Creating a simple NFC application

We will walk through the
major steps for creating a
simple application accessing
hardware capabilities
How to get started
Get the Tizen SDK: (works on Mac OS, Linux and Windows)
https://developer.tizen.org/downloads/tizen-sdk
How to get started
Creating the NfcSimple Application
config.xml
Used when packaging and installing the application, contains attributes such as
ID, name, content (primary HTML file to load), and icon.
index.html
Contains the User Interface: afew labels, a text input to enter the text that is
going to be stored on the tags, and a button to start writing
main.js
Will contain the logic of the application; deals with the NFC chip and with
updating the user interface
Creating the NfcSimple Application
All TizenJS APIs are nested under the tizen object e.g.
tizen.time, tizen.power, etc.
Most of the APIs are driven by exceptions and event listeners when
asynchronous.
The packaged application
Tizen uses the wgt format to package the application.
It’s essentially a zipped file with all your images, and html/css/js files in it.

The wgt package is sent over to the phone and installed using the web
runtime of Tizen, which will add a shortcut on the launch screen.
The packaged application

To complete the Web Platform offering, Tizen offers couple of
JavaScript APIs you can use to make a richer application
NfcSimple: Get the default adapter and power it on
// Get the NFC adapter
try {
adapter = tizen.nfc.getDefaultAdapter();
if (!adapter.powered) {
adapter.setPowered(
true,
// Enable NFC adapter
onPowerOn, // Handle success
function () {
console.log("Power on failed")
}); // Handle failure
} else {
onPowerOn();
}
} catch (err) {
console.log(err.name + ": " + err.message);
}
NfcSimple: Get notifications when a tag is detected
var onTagDetectedCB = {
onattach : function(nfcTag) {
nfcLog("NFC Tag's type is " + nfcTag.type);
// now that Tag is detected, call read
try {
if (!nfcTag.isSupportedNDEF) {
nfcLog('Tag does not support NDEF');
return;
}
nfcLog('Tag supports NDEF; reading messages...');
nfcTag.readNDEF(readCB, onError);
} catch (err) {
console.log(err);
}
}
...
adapter.setTagListener(onTagDetectedCB);
NfcSimple: Write to the tag
var newMessage = new tizen.NDEFMessage();
newMessage.records[0] = new tizen.NDEFRecordText(message, 'en-US', 'UTF8');
nfcTag.writeNDEF(newMessage, onSuccess, onError);

• NDEF is the NFC Data Exchange Format
• Tizen provides a set of APIs to ease manipulating them for read and write
NfcSimple: Try it on the phone
NfcSimple: End result
After deploying to the phone, you should see a result
very similar to what is shown on the right side:
Using standard HTML5, plus a few of the Tizen API’s
it is possible to write really complex and useful
applications.

The Tizen UI Framework (based on jQuery Mobile)
can help you create a Tizen like UI with very little
effort.
Part 3

Responsive design
and good practices
The market today
Different screen sizes/resolutions, densities and even different behavior

Image from the Responsible Web Design – www.abookapart.com/products/responsive-web-design
Post-PC – lots of different devices, happening now
Common solutions
Show desktop pages
Small text (mobile browsers enlarge smartly!)
Lots of annoying pinching and panning
Sniff the user agent
Different content sources
Hard to test property
Breaks when UA string or browser changes
How is the web structured?

Semantics aka HTML
Styling aka CSS
Behavior aka JavaScript
How is the web structured?

We want to be responsive

Semantics aka HTML
Styling aka CSS

Behavior aka JavaScript
How is the web structured?

We want to be responsive

Semantics aka HTML
Styling aka CSS

Behavior aka JavaScript the semantics
We want to keep

but change the rest
Fluid grids (‘dimensions’),
Flexible images and
Media Queries
This is the definition of Responsive Web Design
Time for exploration
How to accomplish something like this?
Fluid dimensions

It’s all about layout
Show, hide, change, reorder

CSS to the rescue!
Fluid dimensions

Lots of real estate
One particular design
Fluid dimensions

Less real estate

A more compact styling
Fluid dimensions

And it goes on…

New layout constructs as Flexible box even
supports reordering cells!
Do not use fixed sizing

Say what???

“Designers are commonly used to the fixed medium,
and as ‘the control freaks they are ;-)’ they want to
achieve pixel perfection “
Insert ‘new mindset’ here

“ Use percentages (%), add min-width: …px
To avoid breaking the design “
Insert ‘new mindset’ here
But be aware
Some words about sub-pixel layout and
the lack there of.
Sub-pixel layout

With a 6 column grid:
100% ÷ 6 = 16.67%
Sub-pixel layout

With a 1000px viewport that is 166.67
Pixel per column, oh, oh…
Sub-pixel layout

If we round to nearest pixel it won’t fit
on screen
Sub-pixel layout

If we round to nearest pixel it won’t fit
on screen

167x6 = 1002
Sub-pixel layout

Only fixed by sub-pixel layout
Supported by IE and newest WebKit based browsers
Meet the Media Query
The media query
Media queries allow you to specify a condition for a block of CSS
If that block is met, the block is applied to your HTML
If not, it is completely ignored
They are an awesome fit for real needs!
The media query
Example
<link rel=“stylesheet” type=“text/css” href=“core.css” media=“screen”>
<link rel=“stylesheet” type=“text/css” href=“print.css” media=“print”>

Format
@media screen and (max-weight: 3kg) and (color), (orientation: portrait) {
...
}
Size breakpoints
Media queries allow that you to add breakpoints given size
<link rel=“stylesheet” type=“text/css”
media=“screen and (max-device-width: 480px*)”
href=“shetland.css” />
@media screen and max-width: 480px) {
.column {
float: none;
}
}

* Be aware of viewport adaptation
Size breakpoints – Adobe Edge Reflow
Adobe provides a nice tools for doing this
Sizing to the viewport
The new viewport related vh/vw units
Viewport width, viewport height units per 100

Want to make sure an element fits inside 1/3 of the viewport?
No need to measure with JavaScript, just use the new units
.element {
width: 33vw;
}
img {
max-height: 95vh;
}
Image resolution and
bandwidth savings
Retina, hi-res, etc.
Device units vs. density independent pixels aka CSS units

De-facto standard

CSS

pixels

height: 2px
width: 2px

height: 2px
width: 2px

Device
pixels

Retina

x4
Media queries and future ideas
Use media queries today
#image { background: url(image.png); }
@media (-webkit-min-device-pixel-ratio: 2) {
#image { background :url(image@2x.png); }
}

Near future
@media (min-resolution: 2dppx) { // or (min-resolution: 192dpi)
#image { background :url(image@2x.png); }
}
Media queries and future ideas
Mat Marques suggested the <picture> element
<picture ...>
#image { background: url(image.png); }
<source media=“(min-resolution: 2dppx)” source=“image@2x.png”>
@media (-webkit-min-device-pixel-ratio: 2) {
<source ...>
<img src=“image.png”>
#image { background :url(image@2x.png); }
</picture>
}

Apple suggested
<image src=“image.png” srcset=“image.png 1x, image@2x.png 2x”>
Viewport adaptation
Viewport adaptation
The CSS viewport is not always the actual 1.0 scale browser view
Keep in mind that the browser view is in CSS units (not device ones)

But then how can a mobile browser fit a whole desktop page?
And not break the layout?
They lie! Most mobile browsers do not layout pages at their true Browser view
Viewport adaptation
Mobile browsers often lays out at 980px or similar
Then they fit the contents to the view, resulting in != 1.0 scale

This is useless for web apps which should use 1 CSS px as 1 UI px.
The viewport meta-tag
The meta tag takes care of that
<meta name=“viewport” contents=“width=device-width, initial-scale=2”>

Very flexible, somewhat ‘quirky’ and hard to understand
<meta name=“viewport” contents=“width=device-width”>

If device-width above is 320 (iPhone default) it will be scaled differently
in portrait than in landscape. Adding ‘maximum-scale=1’ make it “overflow” to 480 in
landscape, as it wasn’t allowed to scale.
CSS Device Adaptation spec
CSS version of the meta tag, easier to use
@viewport {
width: device-width;
}
@media screen and (width: 397px) {
@viewport {
width: 500px;
}
}

Supported already by IE 10 (partial), IE10 mobile, Opera and trunk Webkit
Advanced media queries
How to adapt behavior implemented in JavaScript
Query or listen
mql = window.styleMedia.matchMedium(“(max-width: 480px)”);
if (mql.matches) {
alert(“Gotta have a pizza tonight!”);
}
// Lets subscribe to changes!
mql.addListener(function(result) {
alert(result.matches);
})
Rounding up
Best approach
Rounding up

Responsive design is

There today!

And most works with any modern browser

Retina support, vw/hw units, dppx is new, but should be universally supported
a year from now
Best approach
Mobile first, consider bandwidth constraints
Add additional UI components for larger target screens, keeping
the former in mind
Less subpages
Cut the crap, promote what matters
Less is more!
Thank You!
License Notices
Except where noted, sample source code written by Samsung Electronics Co. Ltd and provided to you is licensed as described below.
Copyright © 2010-2013, Samsung Electronics Co. Ltd. All rights reserved except as otherwise explicitly indicated.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

Neither the name of the Samsung Electronics Co. Ltd nor the names of its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Other source code displayed in this presentation may be offered under other licenses.
Apache 2.0
Copyright © 2010, Android Open Source Project. All rights reserved unless otherwise explicitly indicated.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Creative Commons 3.0 Attribution License
Portions of this presentation are reproduced from work created and shared by Google (http://code.google.com/policies.html) and used according to terms described in the
Creative Commons 3.0 Attribution License (http://creativecommons.org/licenses/by/3.0/).

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

SDC13 - Unleashing Your Inner Web App Developer Using Tizen

  • 1. The Tizen Web Platform, where web apps feels right at home Kenneth Christiansen / Alexis Menard Web Platform Architects Intel Corporation #SDC13
  • 2. Agenda Part 1: The runtime model In this section, the Tizen Web Application model (aka Web Runtime) will be introduced along with its major features. Part 2: Creating an application We will walk through the major steps for creating a simple application accessing hardware capabilities Part 3: Responsive design and good practices Furthermore, we will look at good practices for adapting responsive design, allowing the application to target future Tizen devices, using different resolutions, screen sizes and interaction models
  • 4. What is Tizen Tizen is new OS, backed by industry leaders It is open and the focus is on web apps It targets multiple devices, not just mobile phones In many ways, it is ahead of its time with the focus on web and the extensions to the web platform.
  • 5. What is Tizen Brilliant support for latest HTML5 specs Great performance, good implementations, emerging standards: • Vibrate • Battery • Screen lock Not to forget device API’s currently being standardized in the W3C
  • 6. Why betting on the web Q: What is a web application? Why HTML5 and the web platform: • • • • • • Integration with existing cloud services Most flexible layout engine Reuse existing code and knowledge Cross platform “promise” Immediate update and distribution control (hosted apps) Responsive design
  • 7. Why betting on the web Downsides • • • • • • Timely access to new OS innovations Offline support Access to native capabilities Control over the application (life cycle, launching, etc) Store support Interaction with the interface (viewport, orientation lock, touch control,…) Tizen brings the promises of HTML5 and aims at closing the gaps to native
  • 8. Timely access to new OS innovations Tizen brings its own additional API’s • These are optional (you should code as such) and only available on Tizen • General purpose API’s are being standardized in the W3C together with Mozilla, Intel, Samsung a.o.
  • 9. Offline support Packaged applications • • • • • • Bundle HTML, CSS, other resources incl. manifest Prepared for offline support Based on the W3C Widgets specs Localization support Query manifest from applications Permission control
  • 10. Access to native capabilities The additional Tizen API’s allows you to access a variety of things • Bluetooth, Contacts, Callhistory, NFC, Local Filesystem, etc. • Capabilities are controlled by permissions control similar to that of Android apps
  • 11. Control over the application A variety of API’s available • • • • Deal with discharging battery or control display (Power API) Query manifest (widget.description, widget.version, etc.) Launch application and receive result (App Control API) Schedule tasks: Launch app at a given time (Alarm API) // when the alarm is triggered the app is launched if not already running var alarm = new tizen.AlarmAbsolute(new Data(2013, 10, 4, 8, 0)); tizen.alarm.add(alarm, “org.tizen.browser”); Tizen.application.getCurrentApplication();
  • 12. Interaction with the user interface Great touch and mobile support • • • • Touch interaction and touch events (web facing) Screen Orientation Lock Fullscreen support – per element Viewport meta tag
  • 13. Store support Packaged apps can be distributed via the Tizen Store: http://seller.tizenstore.com
  • 14. Part 2 Creating an application
  • 15. Creating a simple NFC application We will walk through the major steps for creating a simple application accessing hardware capabilities
  • 16. How to get started Get the Tizen SDK: (works on Mac OS, Linux and Windows) https://developer.tizen.org/downloads/tizen-sdk
  • 17. How to get started
  • 18. Creating the NfcSimple Application config.xml Used when packaging and installing the application, contains attributes such as ID, name, content (primary HTML file to load), and icon. index.html Contains the User Interface: afew labels, a text input to enter the text that is going to be stored on the tags, and a button to start writing main.js Will contain the logic of the application; deals with the NFC chip and with updating the user interface
  • 19. Creating the NfcSimple Application All TizenJS APIs are nested under the tizen object e.g. tizen.time, tizen.power, etc. Most of the APIs are driven by exceptions and event listeners when asynchronous.
  • 20. The packaged application Tizen uses the wgt format to package the application. It’s essentially a zipped file with all your images, and html/css/js files in it. The wgt package is sent over to the phone and installed using the web runtime of Tizen, which will add a shortcut on the launch screen.
  • 21. The packaged application To complete the Web Platform offering, Tizen offers couple of JavaScript APIs you can use to make a richer application
  • 22. NfcSimple: Get the default adapter and power it on // Get the NFC adapter try { adapter = tizen.nfc.getDefaultAdapter(); if (!adapter.powered) { adapter.setPowered( true, // Enable NFC adapter onPowerOn, // Handle success function () { console.log("Power on failed") }); // Handle failure } else { onPowerOn(); } } catch (err) { console.log(err.name + ": " + err.message); }
  • 23. NfcSimple: Get notifications when a tag is detected var onTagDetectedCB = { onattach : function(nfcTag) { nfcLog("NFC Tag's type is " + nfcTag.type); // now that Tag is detected, call read try { if (!nfcTag.isSupportedNDEF) { nfcLog('Tag does not support NDEF'); return; } nfcLog('Tag supports NDEF; reading messages...'); nfcTag.readNDEF(readCB, onError); } catch (err) { console.log(err); } } ... adapter.setTagListener(onTagDetectedCB);
  • 24. NfcSimple: Write to the tag var newMessage = new tizen.NDEFMessage(); newMessage.records[0] = new tizen.NDEFRecordText(message, 'en-US', 'UTF8'); nfcTag.writeNDEF(newMessage, onSuccess, onError); • NDEF is the NFC Data Exchange Format • Tizen provides a set of APIs to ease manipulating them for read and write
  • 25. NfcSimple: Try it on the phone
  • 26. NfcSimple: End result After deploying to the phone, you should see a result very similar to what is shown on the right side: Using standard HTML5, plus a few of the Tizen API’s it is possible to write really complex and useful applications. The Tizen UI Framework (based on jQuery Mobile) can help you create a Tizen like UI with very little effort.
  • 28. The market today Different screen sizes/resolutions, densities and even different behavior Image from the Responsible Web Design – www.abookapart.com/products/responsive-web-design
  • 29. Post-PC – lots of different devices, happening now Common solutions Show desktop pages Small text (mobile browsers enlarge smartly!) Lots of annoying pinching and panning Sniff the user agent Different content sources Hard to test property Breaks when UA string or browser changes
  • 30. How is the web structured? Semantics aka HTML Styling aka CSS Behavior aka JavaScript
  • 31. How is the web structured? We want to be responsive Semantics aka HTML Styling aka CSS Behavior aka JavaScript
  • 32. How is the web structured? We want to be responsive Semantics aka HTML Styling aka CSS Behavior aka JavaScript the semantics We want to keep but change the rest
  • 33. Fluid grids (‘dimensions’), Flexible images and Media Queries This is the definition of Responsive Web Design
  • 35. How to accomplish something like this?
  • 36. Fluid dimensions It’s all about layout Show, hide, change, reorder CSS to the rescue!
  • 37. Fluid dimensions Lots of real estate One particular design
  • 38. Fluid dimensions Less real estate A more compact styling
  • 39. Fluid dimensions And it goes on… New layout constructs as Flexible box even supports reordering cells!
  • 40. Do not use fixed sizing Say what??? “Designers are commonly used to the fixed medium, and as ‘the control freaks they are ;-)’ they want to achieve pixel perfection “
  • 41. Insert ‘new mindset’ here “ Use percentages (%), add min-width: …px To avoid breaking the design “
  • 42. Insert ‘new mindset’ here But be aware Some words about sub-pixel layout and the lack there of.
  • 43. Sub-pixel layout With a 6 column grid: 100% ÷ 6 = 16.67%
  • 44. Sub-pixel layout With a 1000px viewport that is 166.67 Pixel per column, oh, oh…
  • 45. Sub-pixel layout If we round to nearest pixel it won’t fit on screen
  • 46. Sub-pixel layout If we round to nearest pixel it won’t fit on screen 167x6 = 1002
  • 47. Sub-pixel layout Only fixed by sub-pixel layout Supported by IE and newest WebKit based browsers
  • 48. Meet the Media Query
  • 49. The media query Media queries allow you to specify a condition for a block of CSS If that block is met, the block is applied to your HTML If not, it is completely ignored They are an awesome fit for real needs!
  • 50. The media query Example <link rel=“stylesheet” type=“text/css” href=“core.css” media=“screen”> <link rel=“stylesheet” type=“text/css” href=“print.css” media=“print”> Format @media screen and (max-weight: 3kg) and (color), (orientation: portrait) { ... }
  • 51. Size breakpoints Media queries allow that you to add breakpoints given size <link rel=“stylesheet” type=“text/css” media=“screen and (max-device-width: 480px*)” href=“shetland.css” /> @media screen and max-width: 480px) { .column { float: none; } } * Be aware of viewport adaptation
  • 52. Size breakpoints – Adobe Edge Reflow Adobe provides a nice tools for doing this
  • 53. Sizing to the viewport
  • 54. The new viewport related vh/vw units Viewport width, viewport height units per 100 Want to make sure an element fits inside 1/3 of the viewport? No need to measure with JavaScript, just use the new units .element { width: 33vw; } img { max-height: 95vh; }
  • 56. Retina, hi-res, etc. Device units vs. density independent pixels aka CSS units De-facto standard CSS pixels height: 2px width: 2px height: 2px width: 2px Device pixels Retina x4
  • 57. Media queries and future ideas Use media queries today #image { background: url(image.png); } @media (-webkit-min-device-pixel-ratio: 2) { #image { background :url(image@2x.png); } } Near future @media (min-resolution: 2dppx) { // or (min-resolution: 192dpi) #image { background :url(image@2x.png); } }
  • 58. Media queries and future ideas Mat Marques suggested the <picture> element <picture ...> #image { background: url(image.png); } <source media=“(min-resolution: 2dppx)” source=“image@2x.png”> @media (-webkit-min-device-pixel-ratio: 2) { <source ...> <img src=“image.png”> #image { background :url(image@2x.png); } </picture> } Apple suggested <image src=“image.png” srcset=“image.png 1x, image@2x.png 2x”>
  • 60. Viewport adaptation The CSS viewport is not always the actual 1.0 scale browser view Keep in mind that the browser view is in CSS units (not device ones) But then how can a mobile browser fit a whole desktop page? And not break the layout? They lie! Most mobile browsers do not layout pages at their true Browser view
  • 61. Viewport adaptation Mobile browsers often lays out at 980px or similar Then they fit the contents to the view, resulting in != 1.0 scale This is useless for web apps which should use 1 CSS px as 1 UI px.
  • 62. The viewport meta-tag The meta tag takes care of that <meta name=“viewport” contents=“width=device-width, initial-scale=2”> Very flexible, somewhat ‘quirky’ and hard to understand <meta name=“viewport” contents=“width=device-width”> If device-width above is 320 (iPhone default) it will be scaled differently in portrait than in landscape. Adding ‘maximum-scale=1’ make it “overflow” to 480 in landscape, as it wasn’t allowed to scale.
  • 63. CSS Device Adaptation spec CSS version of the meta tag, easier to use @viewport { width: device-width; } @media screen and (width: 397px) { @viewport { width: 500px; } } Supported already by IE 10 (partial), IE10 mobile, Opera and trunk Webkit
  • 65. How to adapt behavior implemented in JavaScript Query or listen mql = window.styleMedia.matchMedium(“(max-width: 480px)”); if (mql.matches) { alert(“Gotta have a pizza tonight!”); } // Lets subscribe to changes! mql.addListener(function(result) { alert(result.matches); })
  • 67. Rounding up Responsive design is There today! And most works with any modern browser Retina support, vw/hw units, dppx is new, but should be universally supported a year from now
  • 68. Best approach Mobile first, consider bandwidth constraints Add additional UI components for larger target screens, keeping the former in mind Less subpages Cut the crap, promote what matters Less is more!
  • 70. License Notices Except where noted, sample source code written by Samsung Electronics Co. Ltd and provided to you is licensed as described below. Copyright © 2010-2013, Samsung Electronics Co. Ltd. All rights reserved except as otherwise explicitly indicated. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  Neither the name of the Samsung Electronics Co. Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Other source code displayed in this presentation may be offered under other licenses. Apache 2.0 Copyright © 2010, Android Open Source Project. All rights reserved unless otherwise explicitly indicated. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Creative Commons 3.0 Attribution License Portions of this presentation are reproduced from work created and shared by Google (http://code.google.com/policies.html) and used according to terms described in the Creative Commons 3.0 Attribution License (http://creativecommons.org/licenses/by/3.0/).