Please interrupt me. There is a general perception that apps built using HTML, CSS, and JavaScript are slow. (Hint: We are going to change that in.

Slides:



Advertisements
Similar presentations
What is HTML5…?. ”…removes the need for plugins” ”…can handle multimedia directly” ”…enables rich, interactive clients” ”…enables advanced visual designs”
Advertisements

Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
Web Applications HTML5 Games Windows 8 HTML Apps Basic Web Pages JavaScript Execution Speed DOM Interactions Accelerated Graphics Page Load Time.
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
pirate s Capabilities Developer Investment Web App Hybrid App Native App.
App Development on Android
Android Tutorial Android Written in Java Utilizes Dalvik VM – Just in time (JIT) compilation since Android 2.2.
Development of mobile applications using PhoneGap and HTML 5
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Canvas, SVG, Workers Doncho Minkov Telerik Corporation
Web Apps vs. Native Apps vs. Hybrid Apps vs. iBook Author Mobile Publishing:
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
Lightning Talk Fred Rodriguez Nguyen Do CPSC 473 May 6, 2012.
(1) User Interface Frameworks: Twitter Bootstrap 3.0 Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University.
Building Metro style apps with HTML and JavaScript Paul Gusmorino Lead Program Manager Microsoft Corporation.
Windows Store apps with HTML + Facebook integration
CS378 - Mobile Computing App Project Overview. App Project Teams of 2 or 3 students Develop an Android application of your choosing subject to instructor.
Introduction CIS 136 Building Mobile Apps 1. What is a mobile app? 2  Computer program  Designed for small devices  Smartphones  Tablets  Other handhelds.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
Developing Better PhoneGap Apps Session 608 / DevLearn 2013 Daniel Pfeiffer Lead Developer / Float Mobile Learning.
Developing Cross-Platform Applications with Visual Studio 2015
DHTML Positioning and Layout. What is DHTML? HTML and xHTML CSS JavaScript or VBScript.
Building Metro style apps with HTML and JavaScript Paul Gusmorino Lead Program Manager Microsoft Corporation.
HTML5 for Mobile Andrew Kinai. HTML vs HTML5 HTML:A language that describes documents' formatting and content, which is basically composed of static text.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Strategies for Building Mobile Apps Using ArcGIS API for JavaScript Andy Gup, Lloyd Heberlie.
Embedded Software SKKU 14 1 Sungkyunkwan University Tizen v2.3 Application Profiling & Debugging.
Mobile web Sebastian Lopienski IT Technical Forum 29 June 2012.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
. Taught by: Muhammad Ali Baloch midahot. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between.
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
Apache Cordova Tools in Visual Studio
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
CSS1 Dynamic HTML Objects, Collections & Events. CSS2 Introduction Dynamic HTML treats HTML elements as objects. Element’s parameters can be treated as.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
Introduction - There is nothing more frustrating than being indecisive. A bad decision often costs a lot of money, time and efforts. Seldom have you come.
Ionic & Cordova crash course Ivan Varga
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Live Mobile and Cloud Hacking by ACEs OGh | Fusion Middleware Experience (FME) 16-feb :45 – 16:45.
Introduction to JavaScript LIS390W1A Web Technologies and Techniques 24 Oct M. Cameron Jones.
Chapter 1 Ionic Framework (overview) Front-end framework for developing hybrid mobile apps with HTML5 Yeunyong Kantanet School of Information and Communication.
 Can access all API’s made available by OS vendor.  SDK’s are platform-specific.  Each mobile OS comes with its own unique tools and GUI toolkit.
丁建文 國立高雄應用科大資管系副教授 兼任計網中心軟體發展組組長 跨平台行動應用軟體開發技術 : HTML5 & Mobile JavaScript Framework 暨南大學.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
M ULTIMEDIA ON THE W EB. Multimedia Purpose of Multimedia Multimedia Issues HTML5 and elements CSS Transitions and Animations Animation to avoid.
APP DESIGN AND DEVELOPMENT WITH THE IONIC FRAMEWORK Chuck Leone
Phonegap API & Phonegap Bridge CIS 136 Building Mobile Apps 1.
Build Hybrid Mobile Apps with Ionic, Angular, & Cordova Brian
PhoneGap. web-based mobile development framework, based on the open-source Cordova project. use standard web technologies such as HTML5, CSS3, and JavaScript.
TELERIK APP BUILDER ( Icenium ). POINTS TO DISCUSS  Introduction  Features  Versions  Supported Frameworks.
Ionic Mobile App Development Services
PhoneGap Cross-Platform Development Company India
PhoneGap, Processing.
Javascript and Dynamic Web Pages: Client Side Processing
Build performance-obsessed mobile apps with JavaScript
Building Cordova Apps for Windows 10
JavaScript Functions.
Building beautiful and interactive apps with HTML5 & CSS3
Revision.
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
Building responsive apps and sites with HTML5 web workers
HTML5 Course Review Master a Skill / Learn for Life.
Hello, world!.
Front End Development workshop
Web Programming and Design
Presentation transcript:

Please interrupt me.

There is a general perception that apps built using HTML, CSS, and JavaScript are slow. (Hint: We are going to change that in this session)

Because science!

// The Basics

Apache Cordova apps are written in HTML, CSS, and JavaScript that can also access native device capabilities.

Cordova apps are web applications that run inside a native application. This allows you to use HTML, CSS, and JavaScript to build your app while still having access to your device’s hardware capabilities! Native Wrapper Your JavaScript App Cordova Plugin JS API

What does it mean for something to be fast and responsive?

Interaction Classes

What we care about!

Methodology

1. The Webview Tax 2. Document Object Model (DOM) 3. Images 4. Animation 5. Garbage Collection 6. UI Controls

// The Webview Tax

// Document Object Model (DOM)

Bad Alpha Zeta Tao Epsilon

Good Alpha Zeta Tao Epsilon

Layout Thrashing

Bad for (var i = b.children.length - 1; i >= 0; i--) { b.children[i].style.left = b.children[i].offsetLeft + "px"; b.children[i].style.top = b.children[i].offsetTop + "px"; }

Good for (var i = b.children.length - 1; i >= 0; i--) { topPx[i] = b.children[i].offsetTop; leftPx[i] = b.children[i].offsetLeft; } for (var i = b.children.length - 1; i >= 0; i--) { b.children[i].style.left = leftPx[i] + "px"; b.children[i].style.top = topPx[i] + "px"; }

Fast List Scrolling

Memory Usage: Virtualized List vs. Non-Virtualized List

Use virtualization When working with large amounts of data, only work with the data you need to display content on the screen. (Popular control frameworks like WinJS, Ionic, Onsen UI, Kendo UI and others help handle this for you.)

// Images

Gradients

Bad.css_gradient { background: -webkit-linear-gradient(top,rgb(84, 1, 1),rgb(0, 84, 119)); /*Safari 5.1-6*/ background: -o-linear-gradient(top,rgb(84, 1, 1),rgb(0, 84, 119)); /*Opera */ background: -moz-linear-gradient(tp,rgb(84, 1, 1),rgb(0, 84, 119)); /*Fx */ background: linear-gradient(top, rgb(84, 1, 1),rgb(0, 84, 119)); /*Standard*/ }

Good.image_gradient { background: url('../images/gradient.png'); }

// Animation

Setting Element Position

bobble { 0% { left: 50px; animation-timing-function: ease-in; } 50% { left: 50px; top: 50px; animation-timing-function: ease-out; } 100% { left: 50px; top: 40px; }

bobble { 0% { transform: translate3d(50px, 40px, 0px); animation-timing-function: ease-in; } 50% { transform: translate3d(50px, 50px, 0px); animation-timing-function: ease-out; } 100% { transform: translate3d(50px, 40px, 0px); }

CSS vs. JavaScript

// Garbage Collection

Bad function createElements() { for (var i = 0; i < 100; ++i) { var xBtn = document.createElement('button'); xBtn.setAttribute('value', 'AA'); xBtn.addEventListener('click', hi, false); containerDiv.appendChild(xBtn); xBtn = null; } function clearElements() { containerDiv.innerHTML = ""; }

Good function createElements() { for (var i = 0; i < 100; ++i) { var xBtn = document.createElement('button'); xBtn.setAttribute('value', 'AA'); xBtn.addEventListener('click', hi, false); containerDiv.appendChild(xBtn); xBtn = null; } function clearElements() { var els = containerDiv.childNodes; for (var i = 0; i < els.length; i++) { els[i].removeEventListener('click', hi, false); containerDiv.removeChild(els[i]); }

Minimize Unnecessary Event Listeners

/* bad *//* good */

Let’s say you want to listen to a click event on the elements with the id value of one, two, three, four, and five. Note: They share a common parent with the theDude element!

Bad // ONE FUNCTION FOR EACH EVENT LISTENER for (i = 0; i < 100; i++){ img[i].addEventListener("click", function clickListener(e) { var clickedItem = e.target.id; alert("Hello " + clickedItem); }); }

Good var theParent = document.querySelector("#theDude"); theParent.addEventListener("click", doSomething, false); function doSomething(e) { if (e.target !== e.currentTarget) { var clickedItem = e.target.id; alert("Hello " + clickedItem); } e.stopPropagation(); }

Pay Attention to Memory Leaks

Bad // el is in the global scope, so it persists with the document var el; function doSomething() { el = document.createElement('div'); parent.appendChild(el); } function empty() { parent.innerHTML = ""; }

Good // el is in the local scope, so expires with the function function doSomething() { var el = document.createElement('div'); parent.appendChild(el); } function empty() { parent.innerHTML = ""; }

// UI Controls

“Fast” Clicking

Practical Advice (1/3)

Practical Advice (2/3)

Practical Advice (3/3)