SlideShare a Scribd company logo
Hybrid Apps with
Ember
@alexblom
alex@isleofcode.com
Who am I
• Programmer
• Started with Java/C;
• Mostly Ruby/Rails;
• Go;
• Ember for ~2.5 years;
Isle of Code
• Toronto based development;
• Focused on:
• Prototyping;
• Single sourcing mobile /w Ember.js & Cordova;
and
• A lot of beacon work.
Five things audience
members will learn
1. How to build a single code base working on all platforms
2. What changes (if any) are required in the code base to
achieve this
3. How to avoid common draw-backs of wrapped
applications, such as perceived slowness
4. How to access native phone functions without muddling
up the code base
5. How such applications are packaged and deployed
Contents
• 1: What are hybrid apps?;
• 2: Our tools (Cordova, Ember & Good
Programming);
• 3: Make it go zoom;
1 - What are hybrid
apps
• Using one code base for multiple platforms;
• vs. building custom code bases for each platform;
Wrapped Apps are
everywhere
Less cost of building
Re-use app for web
Less cost to add new
features
No out of sync
experiences
How important is
complexity?
How easy is it for you
to find engineers?
“The biggest mistake we’ve made as a company is
betting on HTML5 over native”
Mark Zuckerberg, 2012
2 - Our Tools
What is Cordova?
• Apache Cordova is a platform for building native
mobile applications using HTML, CSS and
JavaScript
• https://cordova.apache.org/
• "Cordova" refers to the street the office was on
when the PhoneGap project first began
Cordova vs Phonegap
UIWebView
(mostly) consistent
API’s
Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js
The Ember way is not
about Ember
ember-cli-cordova
Cordova/Ember is easier
now
• Process has come a long way
Bind Cordova Service
https://github.com/isleofcode/ember-cli-cordova
Livereload
3 - Make it go Zoom
Good Code == Good Hybrid
• Much of making effective mobile is simply writing
good code.
• Desktops let us be lazier;
Cordova is not native
Cordova is not native
<preference name="webviewbounce"
value="false" />
Touch Events
http://hammerjs.github.io
Hammer Example
Ember Gestures
https://github.com/runspired/ember-gestures
Ghost Clicks
Ember Hack
Manage Reflows
Manage Reflows
• “Reflow is the process by which the geometry of the
layout engine's formatting objects are computed. The
HTML formatting objects are called frames: a frame
corresponds to the geometric information for (roughly) a
single element in the content model; the frames are
arranged into a hierarchy that parallels the containment
hierarchy in the content model. A frame is rectangular,
with width, height, and an offset from the parent frame
that contains it.”
• http://www-archive.mozilla.org/newlayout/doc/reflow.html
What causes Reflow?
• Resizing the browser window;
• using JavaScript methods involving computed
styles;
• adding or removing elements from the DOM; and
• changing an element's classes.
• https://developers.google.com/speed/articles/reflo
w
Use CSS Transforms
visibility:hidden
Best Practices for avoiding
Reflow
1. Avoid setting multiple inline styles; avoid setting styles individually.
2. Use class names of elements, and do so as low in the DOM tree as possible.
3. Batch your DOM changes and perform them offline;
4. Avoid computing styles too often. If you must then cache those values.
5. Apply animations with position: fixed or absolute so it doesn’t affect the layout of other elements.
6. Avoid table layouts, they trigger more reflows than block layouts because multiple passes must be made over
the elements.
7. Reduce unnecessary DOM depth. Changes at one level in the DOM tree can cause changes at every level of
the tree - all the way up to the root, and all the the way down into the children of the modified node. This leads
to more time being spent performing reflow.
8. Minimize CSS rules and remove unused CSS rules.
9. If you make complex rendering changes such as animations, do so out of the flow. Use position-absolute or
position-fixed to accomplish this.
10.Avoid unnecessary complex CSS selectors - descendant selectors in particular.
http://stage.docs.phonegap.com/tutorials/optimize/03-min-reflows/
-webkit-tap-highlight-color:rgba(0,0,0,0);
Understand Viewport
Android Viewport
iOS 7+ Viewport
ionic Keyboard
• cordova.plugins.Keyboard.isVisible
• cordova.plugins.Keyboard.hideKeyboardAccessoryBar
• cordova.plugins.Keyboard.close
• cordova.plugins.Keyboard.disableScroll
• cordova.plugins.Keyboard.show
• https://github.com/driftyco/ionic-plugin-keyboard
Infinite Scrolling
• Smoke & Mirrors:
https://github.com/runspired/smoke-and-mirrors
• Ember ListView: https://github.com/emberjs/list-
view
• Ember Cloaking:
https://github.com/eviltrout/ember-cloaking
Occlusion
http://runspired.github.io/smoke-and-mirrors/#/examples/dbmon
Animations
Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js
Animations - Velocity
Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js
Canvas
• Choppy and deal breaking. This is common when
working with DOM;
• Need to move to Canvas;
• ~16ms target for animations, DOM can’t do this;
Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js
Mirage
https://github.com/samselikoff/ember-cli-mirage
Liquid Fire
http://ef4.github.io/liquid-fire/
Crosswalk
https://crosswalk-project.org/
Hybrid Apps with
Ember
@alexblom
alex@isleofcode.com

More Related Content

PDF
Cordova 3.x
PDF
Snappy Means Happy: Performance in Ember Apps
PPTX
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
PPTX
Building Browser Extensions with Ember
PPTX
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
PPTX
Functional webapplicaations using fsharp and suave
PDF
Metaprogramming Go
PDF
Building desktop apps in 2016
Cordova 3.x
Snappy Means Happy: Performance in Ember Apps
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Building Browser Extensions with Ember
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PPT
Functional webapplicaations using fsharp and suave
Metaprogramming Go
Building desktop apps in 2016

What's hot (20)

PPTX
Ui Testing on Windows Phone
PDF
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PDF
PDF
Joomla! multiplied - How to run Multi-Sites - JandBeyond 2014
PDF
An Introduction to ReactNative
PPTX
The front end toolkit
PPTX
SharePoint Saturday Cincinnati 2014 - CSOM
PPT
Web based desktop
ODP
Learn Once; Write Anywhere
PPTX
PhoneGap Day EU 2017: Hybrid Ember Apps
PDF
Terminal Happiness
PPTX
Phonegap - An Introduction
PDF
Prototyping in Figma
PDF
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
PPTX
Oleksandr Skachkov "How to run WebAssembly in your React web application"
PPTX
Blazor - .NET in the Browser!
PDF
Approaching APIs
PPTX
Introduction to-react
PPTX
Getting started with Xamarin forms
PDF
Lessons Learned from Using Next.js in Production
ODP
Flex Appeal
Ui Testing on Windows Phone
Mark Wall - F5 Agility 2017 - F5 Automation The Journey - PDF
Joomla! multiplied - How to run Multi-Sites - JandBeyond 2014
An Introduction to ReactNative
The front end toolkit
SharePoint Saturday Cincinnati 2014 - CSOM
Web based desktop
Learn Once; Write Anywhere
PhoneGap Day EU 2017: Hybrid Ember Apps
Terminal Happiness
Phonegap - An Introduction
Prototyping in Figma
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Blazor - .NET in the Browser!
Approaching APIs
Introduction to-react
Getting started with Xamarin forms
Lessons Learned from Using Next.js in Production
Flex Appeal
Ad

Viewers also liked (13)

PDF
Inclusion educativa
PPT
Lviv Startup Club 10, Arts community
PPTX
Михайло Бєлов "Презентація стартапу Gas visor"
PDF
Damien Piller > Rapport annuel de gestion 2012
PDF
Magazine design
PPTX
Los 7 hábitos de la gente altamente efectiva jose
PPTX
Практичний досвід копікату на російському ринок
PDF
Ember At Scale
PDF
Damien piller sept sera surprenant et novateur Damien Piller
PDF
Learn You a Frege for Great Good!
PDF
Tibox catalogue 2012
PDF
Online travel report by Dealroom June 2016
PDF
IV. Symposium Change to Kaizen [Broschüre]
Inclusion educativa
Lviv Startup Club 10, Arts community
Михайло Бєлов "Презентація стартапу Gas visor"
Damien Piller > Rapport annuel de gestion 2012
Magazine design
Los 7 hábitos de la gente altamente efectiva jose
Практичний досвід копікату на російському ринок
Ember At Scale
Damien piller sept sera surprenant et novateur Damien Piller
Learn You a Frege for Great Good!
Tibox catalogue 2012
Online travel report by Dealroom June 2016
IV. Symposium Change to Kaizen [Broschüre]
Ad

Similar to Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js (20)

PDF
Web, Native iOS and Native Android with One Ember.js App
PPTX
Ember Conf 2016: Building Mobile Apps with Ember
PPTX
Hybrid Mobile Applications
PDF
[2015/2016] Apache Cordova
PDF
The future is hybrid
PDF
Cordova and PhoneGap Insights
PPTX
Flu3nt highlights
PPTX
Mobile native-hacks
KEY
20120802 timisoara
PDF
Building native mobile apps using web technologies
PPTX
Phone gap development, testing, and debugging
PDF
Building mobile apps with PhoneGap and Backbone
PDF
Apache Cordova 4.x
PDF
Designing True Cross-Platform Apps
PDF
Mobile Development with PhoneGap
PDF
Building Cross-Platform Mobile Apps
KEY
PPTX
Building an Ionic hybrid mobile app with TypeScript
KEY
20120306 dublin js
PDF
Apache Cordova
Web, Native iOS and Native Android with One Ember.js App
Ember Conf 2016: Building Mobile Apps with Ember
Hybrid Mobile Applications
[2015/2016] Apache Cordova
The future is hybrid
Cordova and PhoneGap Insights
Flu3nt highlights
Mobile native-hacks
20120802 timisoara
Building native mobile apps using web technologies
Phone gap development, testing, and debugging
Building mobile apps with PhoneGap and Backbone
Apache Cordova 4.x
Designing True Cross-Platform Apps
Mobile Development with PhoneGap
Building Cross-Platform Mobile Apps
Building an Ionic hybrid mobile app with TypeScript
20120306 dublin js
Apache Cordova

More from Alex Blom (7)

PPTX
PG Day Us: Animations for Web & Hybrid
PPTX
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
PPTX
Build email apps with morse.io
PPT
Innovation Growth Strategies for Small Business
PDF
Freelance Camp Toronto: How to sell to Enterprise by Dr Cindy Gordon
PPTX
Freelance Camp Toronto: Social is not new and the 7 biggest social mistakes
PPTX
Ryerson 6th August
PG Day Us: Animations for Web & Hybrid
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Build email apps with morse.io
Innovation Growth Strategies for Small Business
Freelance Camp Toronto: How to sell to Enterprise by Dr Cindy Gordon
Freelance Camp Toronto: Social is not new and the 7 biggest social mistakes
Ryerson 6th August

Recently uploaded (6)

PPTX
ASMS Telecommunication company Profile
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
DOC
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
PPTX
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
ASMS Telecommunication company Profile
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx

Web Unleashed Toronto 2015: Hybrid Mobile Apps with Ember.js