Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Html5 Mobile Apps: Tips & Tricks
Search
Elijah Glover
March 28, 2013
Programming
610
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Html5 Mobile Apps: Tips & Tricks
Elijah Glover
March 28, 2013
Other Decks in Programming
See All in Programming
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
290
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.6k
Lessons from Spec-Driven Development
simas
PRO
0
210
Oxcを導入して開発体験が向上した話
yug1224
4
320
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
270
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.3k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
Agentic UI
manfredsteyer
PRO
0
180
Featured
See All Featured
The Curse of the Amulet
leimatthew05
1
13k
Making Projects Easy
brettharned
120
6.7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
Unsuck your backbone
ammeep
672
58k
Visualization
eitanlees
152
17k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
370
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
260
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
240
Exploring anti-patterns in Rails
aemeredith
3
420
Transcript
HTML5 MOBILE APPS Tips & Tricks Elijah Glover
[email protected]
@elijahglover
What We Are Building HTML5 Mobile app used by ~
3.5m iPhone, Android, Blackberry & Windows Phone No Mobile Frameworks - ie. jQuery Mobile
HOW MODERN ARE PHONE BROWSERS? iOS 4, Android 2.2 runs
the equivalent webkit version of Google Chrome 5 (Q2 2010) iOS 6, Android 4.2 runs the equivalent webkit version of Google Chrome 26 (Q1 2013 ~ Current) Most mobile browsers are based off the webkit project
FRAMEWORKS knockout.js MVVM Framework require.js AMD Loader, IoC/DI sammy.js Routing
Framework modernizr Browser Feature Detection
SINGLE PAGE APPS (SPA)
UNDER THE HOOD define("vm/login", ! ["ko", "jQuery"], ! function(ko, $)
{ ! ! var self = this; ! ! self.userName = ko.observable(); ! ! self.password = ko.observable(); ! ! ko.applyBindings(self, $("#login")[0]); ! ! return self; ! })); var app = Sammy('#app', function() { ! this.get('#/login', function() { ! ! require(["vm/login"], function(viewModel) { ! ! ! $("#login").show(); ! ! }); ! }); }); app.run('#/login');
//Use Modernizr To Detect Prefixed Event Name var animationEndName =
(Modernizr.prefixed('animation') + "End") .replace(/^ms/, "MS") .replace(/^Webkit/, "webkit") .replace(/^Moz.*/, "animationend"); //Bind Once & Wait For AnimationEnd To Be Called $("#view1").one(animationEndName, function() { ! //Animation Complete }).addClass("view-transition"); ANIMATION & TRANSITIONS iOS 3.2+ Android 2.1+ Blackberry 6.0+ Windows Phone 8+ Native CSS3 Support
ANIMATION & TRANSITIONS Windows Phone 7 //Detect Support For CSS3
Animations if (!Modernizr.cssanimations) { ! $("#view1").animate({ left: 200 }, { ! ! complete: function() { ! ! ! //Animation Complete ! ! } ! }); } DOM Animation via jQuery
VIEWPORT <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" /> The viewport
you specify is important! It tells the browser how to render your page Android ignores CSS3 properties when user-scalable is set to yes.
CSS GOTCHA’S position: fixed; iOS 5+, Android 2.2+, BlackBerry 7+,
Windows Phone 8 overflow: scroll; iOS 5+, Android 2.2+, BlackBerry 7+, Windows Phone 8 overflow-x: scroll; -webkit-overflow-scrolling: touch; //Adds Smooth Scrolling overthrow.js - http://filamentgroup.github.com/Overthrow/ iOS4, Android 2.1, Blackberry 6
EMULATORS & SIMULATORS TOOLKIT Xcode iOS Simulator (OSX) Android SDK
Emulator (Windows, OSX, Linux) Windows Phone Emulator (Windows) Blackberry Simulator (Windows)
WEb INspector REmote WEINRE “winery” <script src="http://localhost:8080/target/target-script-min.js"></script>
HTML5 Feature Matrix http://mobilehtml5.org/ Mobile Emulators & Simulators: The Ultimate
Guide http://www.mobilexweb.com/emulators