SlideShare une entreprise Scribd logo
1  sur  68
Télécharger pour lire hors ligne
Javascript
Strategies

For Hybrid Apps
and Mobile Web
Sunday, November 17, 2013
Nuria Ruiz
@pantojacoder

Sunday, November 17, 2013
5 million unique users
per week
50% use Mobile
2 million use Mobile Only
Sunday, November 17, 2013
HTML5

Sunday, November 17, 2013

Native
HTML5

Native

Not your average mobile
website. See Forecast.io

Sunday, November 17, 2013
HTML5

Sunday, November 17, 2013

Native
HTML5

Sunday, November 17, 2013

Native
A Hybrid App is a
Mobile App in which
some
of the main
functionality is web
based
Sunday, November 17, 2013
Disclaimer: We
are talking
remote
webviews
Sunday, November 17, 2013
HTML5

Sunday, November 17, 2013

Native
Disclaimer: We
are talking
remote
webviews

Important: Not all Javascript
has to be remote. You can mix
local and remote Javascript

Sunday, November 17, 2013
<interlude>

Sunday, November 17, 2013
Intrinsic Differences
Between Mobile Web and
Webviews

Sunday, November 17, 2013
1.You can pack part
of your Javascript
with the App.

Sunday, November 17, 2013
Sunday, November 17, 2013
2. You can very
easily open Native
functionality from
a WebView.

Sunday, November 17, 2013
my-protocol://profile/123456

Link to
profile

Sunday, November 17, 2013
3. End of sessions
are likely not 301s
anymore.

Sunday, November 17, 2013
4. Offline.

AppCache Issues
Improving AppCache
Sunday, November 17, 2013
</interlude>

Sunday, November 17, 2013
Hybrid Apps
Value
Proposition
Sunday, November 17, 2013
Best of both
worlds
Or messy marriage?

Sunday, November 17, 2013
What is the web good at?
Portability
Layout, formatting text.
Delivery
Sunday, November 17, 2013
What is the web good at?
Portability
Share Functionality
Layout, formatting text.
Fast Prototyping
Delivery
You Control the Updates
Sunday, November 17, 2013
Not so Good.

Sunday, November 17, 2013
Not so Good.
Performance?

Sunday, November 17, 2013
Not so Good.
Performance?

IOS Browser Speed Bake off
Sunday, November 17, 2013
Not so Good.
Performance?

Performance differences are mostly
determined by network speed
IOS Browser Speed Bake off
Sunday, November 17, 2013
Not so Good.
Performance?
In Android
Native Browser ~ WebView Browser

Uses V8
Sunday, November 17, 2013
Not so Good. Tools

Android Webview Debug Tools
Sencha FastBook
Linked In Mobile Breakup
Sunday, November 17, 2013
The
Basic Rule
Sunday, November 17, 2013
Know Your
User Base

Sunday, November 17, 2013
Know Your
User Base

Because It Determines

Your strategy

Sunday, November 17, 2013
beyond-the-mobile-web-yibu
Sunday, November 17, 2013
Example
Sunday, November 17, 2013
Sunday, November 17, 2013
On 2011 - 500K pageviews daily

Sunday, November 17, 2013
On 2011 - 500K pageviews daily
We still have about 100k daily

Says that it supports Javascript..
but it doesn’t really

Sunday, November 17, 2013
m.tuenti this week

No Javascript
support to
speak of
Sunday, November 17, 2013
Sunday, November 17, 2013
The
Strategy
Sunday, November 17, 2013
1. Be Plain
Sunday, November 17, 2013
Have a
version
1. Be Plain without
Javascript that works
everywhere
Sunday, November 17, 2013
Plain
navigation
No-Ajax
submit

Sunday, November 17, 2013
Plain
navigation
A webview
in a low-grade
Android would
see a ‘plain’
version
Sunday, November 17, 2013

No-Ajax
submit
Bonus: Dumb Site

can be used for not so
smart desktop

browsers ... IE6/IE7
Sunday, November 17, 2013
2. Augment
Sunday, November 17, 2013
no JS
2. Augment on first
pageload, once loaded
decorate
Sunday, November 17, 2013
Fastest
Javascript is the

one you do not need to

execute

Sunday, November 17, 2013
How?

Sunday, November 17, 2013
How?

Sunday, November 17, 2013

Composed via
annotations
in code. No
client-side
loader
framework
needed
How?
<?php
/*
@DependencyFileList(requires="js/wap/tuportal.js, js/wap/
tuportal/voicemail.js")
*/
class TuvoicemailPageCoordinator {
}

// Controller code goes here

Sunday, November 17, 2013
Responsive
Design starts on
the server

Sunday, November 17, 2013
HTTP request
Rough User Agent
Detection
Windows Phone7
No Javascript

Sunday, November 17, 2013
Responsive
Design is not
always possible

Sunday, November 17, 2013
HTTP request
Rough User Agent
Detection
Android < 4.*

jPlayer
Sunday, November 17, 2013
3. Be Fancy
Sunday, November 17, 2013
3. Be Fancy, access
native functionality from
webview
Sunday, November 17, 2013
WebView can
access the
device
camera via
Javascript

Sunday, November 17, 2013
http://cordova.apache.org
Sunday, November 17, 2013
http://www.appgyver.com/steroids
Sunday, November 17, 2013
Disclaimer: We
are talking
remote
webviews

Not the standard way to set up
your PhoneGap App

Sunday, November 17, 2013
Cordova is big, 70K
compressed
Have the communication
bridge deployed locally.
Rest of JS is remote.
Sunday, November 17, 2013
Android 2.3
requires some
contortions

Sunday, November 17, 2013
public class MyWebViewClient extends CordovaWebViewClient {
/**
Once the page has finished loading
it loads cordova in a non blocking fashion.
Note that this means that cordova
initialization is slower for 2.* clients than
it would be for 4.* clients as it happens
after the DOMContentRender event
**/
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:" + this.readFile("cordova.js"));
super.onPageFinished(view, url)

}

}

}

Sunday, November 17, 2013
Conclusion
Sunday, November 17, 2013
Worth Trying
Sunday, November 17, 2013
Questions
Sunday, November 17, 2013

@pantojacoder

Contenu connexe

En vedette

The Editor is Important - Modern WYSIWYG Editing
The Editor is Important - Modern WYSIWYG EditingThe Editor is Important - Modern WYSIWYG Editing
The Editor is Important - Modern WYSIWYG EditingDamien Fitzpatrick
 
Levent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerLevent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerErik Isaksen
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptDarren Mothersele
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with Reactpeychevi
 
Modular Design with Web Components
Modular Design with Web ComponentsModular Design with Web Components
Modular Design with Web ComponentsC4Media
 
Comparaison de plateformes Cloud
Comparaison de plateformes CloudComparaison de plateformes Cloud
Comparaison de plateformes CloudQuentin Apruzzese
 
TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08Andy Gelme
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Mark Leusink
 
Pretty Matters: Web Components, Material Design and Polymer
Pretty Matters: Web Components, Material Design and PolymerPretty Matters: Web Components, Material Design and Polymer
Pretty Matters: Web Components, Material Design and PolymerMaria Clara Santana
 
Using cloud tools to build enterprise mobile apps with APIs fast
Using cloud tools to build enterprise mobile apps with APIs fast Using cloud tools to build enterprise mobile apps with APIs fast
Using cloud tools to build enterprise mobile apps with APIs fast Max Katz
 
Designing Web Interfaces
Designing Web InterfacesDesigning Web Interfaces
Designing Web InterfacesBill Scott
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerRob Dodson
 
Seminar Android - Pengenalan PhoneGap
Seminar Android - Pengenalan PhoneGapSeminar Android - Pengenalan PhoneGap
Seminar Android - Pengenalan PhoneGapNur Hidayat
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstRaymond Camden
 

En vedette (17)

The Editor is Important - Modern WYSIWYG Editing
The Editor is Important - Modern WYSIWYG EditingThe Editor is Important - Modern WYSIWYG Editing
The Editor is Important - Modern WYSIWYG Editing
 
Levent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & PolymerLevent-Gurses' Introduction to Web Components & Polymer
Levent-Gurses' Introduction to Web Components & Polymer
 
Ionic creator
Ionic creatorIonic creator
Ionic creator
 
Media and Disasters
Media and DisastersMedia and Disasters
Media and Disasters
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
Creating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with ReactCreating a WYSIWYG Editor with React
Creating a WYSIWYG Editor with React
 
Modular Design with Web Components
Modular Design with Web ComponentsModular Design with Web Components
Modular Design with Web Components
 
Comparaison de plateformes Cloud
Comparaison de plateformes CloudComparaison de plateformes Cloud
Comparaison de plateformes Cloud
 
TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08
 
Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)Creating mobile apps - an introduction to Ionic (Engage 2016)
Creating mobile apps - an introduction to Ionic (Engage 2016)
 
Pretty Matters: Web Components, Material Design and Polymer
Pretty Matters: Web Components, Material Design and PolymerPretty Matters: Web Components, Material Design and Polymer
Pretty Matters: Web Components, Material Design and Polymer
 
Using cloud tools to build enterprise mobile apps with APIs fast
Using cloud tools to build enterprise mobile apps with APIs fast Using cloud tools to build enterprise mobile apps with APIs fast
Using cloud tools to build enterprise mobile apps with APIs fast
 
Designing Web Interfaces
Designing Web InterfacesDesigning Web Interfaces
Designing Web Interfaces
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer
 
Appery.io - Basic
Appery.io - BasicAppery.io - Basic
Appery.io - Basic
 
Seminar Android - Pengenalan PhoneGap
Seminar Android - Pengenalan PhoneGapSeminar Android - Pengenalan PhoneGap
Seminar Android - Pengenalan PhoneGap
 
Cordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirstCordova + Ionic + MobileFirst
Cordova + Ionic + MobileFirst
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Javascript Strategies for Hybrid Apps and Mobile Web