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
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Adam Lu
January 24, 2013
Technology
670
14
Share
一步一步开发HTML5 Mobile Apps
Adam Lu
January 24, 2013
More Decks by Adam Lu
See All by Adam Lu
YUI Rocks!
adamlu
3
3.1k
YUI介绍和使用YUI构建web应用
adamlu
2
3.7k
HTML5概览
adamlu
13
3.7k
Other Decks in Technology
See All in Technology
GoとSIMDとWasmの今。
askua
2
450
電子辞書Brainをネットに繋げてみた(自力編)
raspython3
0
410
React、まだ楽しくて草
uhyo
7
3.7k
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
1
640
製造業のクラウド活用最適解〜AI,DXを加速するデータ基盤の作り方〜
hamadakoji
0
250
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.8k
脅威をエンジニアリングの糧にして:恐怖を乗り越えた先にあったもの / Turn threats into fuel for engineering: what lay beyond overcoming fear
nrslib
1
370
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
サプライチェーンセキュリティの空白地帯 - 信頼できる”依存性”の未来を考える
rung
PRO
2
620
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
570
Chart.js が簡単に使えるようになっていたので OGP 画像生成に使った話
kamekyame
0
120
テストコードのないプロジェクトにテストを根付かせる
tttol
1
240
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Making Projects Easy
brettharned
120
6.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Producing Creativity
orderedlist
PRO
348
40k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
380
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
What's in a price? How to price your products and services
michaelherold
247
13k
Transcript
一步一步开发 HTML5 移动应用 鲁超伍 Adam Lu @adamlu
HTML5 还是 Native
Fastbook
移动应用的博弈 • 特性丰富度 • 性能 • 开发者经验 • • 感官
• 可发现性 • 货币化
为什么要开发 HTML5 Web Apps • 跨系统 / 平台 / 浏览器
• 易扩展 • 跨设备开发减少成本
支持 HTML5 的移动浏览器
基于 HTML5 应用之服务器端架构 • 可以和传统的 Web 架构类似 ( 浏览器不关心 )
• 可以考虑使用 REST 设计, JavaScript 加载和 管理状态 管理状态
基于 HTML5 应用之前端架构 Data Application HTML5 UI Elements Template
BOILERPLATE 开发第一步
Boilerplate 核心之 HTML • Mobile viewport – <meta name="viewport" content="width=device-
width"> • Home screen icon set • Home screen icon set • iOS web app – <meta name="apple-mobile-web-app-capable" content="yes"> • HTML5 新标签
Boilerplate 核心之 CSS • Reset CSS – normalize.css/YUI Reset CSS/HTML5
Reset • CSS Font
Boilerplate 核心之 JavaScript • 选择基础类库 – Zepto/YUI/jQuery/Underscore/ • 选择功能类库 –
Hammer.js/YUI/iScroll/ – Hammer.js/YUI/iScroll/
USER INTERACTION 开发第二步
HTML5 移动开发框架 • PhoneGap • Trigger.io • AppMobi • App
Accelerator • App Accelerator
客户端的 MVC • Backbones • YUI App Framework • KnockoutJs
Backbone.js
Backbone with REST • Sync 处理器对应 REST 的 CRUD 操作
– Create = HTTP POST – Read = HTTP GET – Update = HTTP PUT – Update = HTTP PUT – Delete = HTTP Delete URL Verb Description /entities GET fetch entities /entities POST create entity /entities/id PUT modify entity /entities/id DELETE delete entity
YUI App Framework • Model+View+Router • Pjax = pushState +
Ajax
客户端模板系统 • Handlebar • Mustache
UI 框架 • jQuery Mobile • Sencha Touch • Kendo
UI
Kendo UI http://demos.kendoui.com/mobile/overview/index.html
PERFORMANCE, USER EXPERIENCE 开发第三步
性能 • Manifest • LocalStorage • SessionStorage • CSS3 Animation
• CSS3 Animation • Cache
使用模块组织你的代码 • AMD (异步模块定义) – RequireJS – SeaJS – YUI
Module – YUI Module
RequireJs: YUI Module
响应 Mobile
媒体查询 • @media all and (min-width:500px) { … } •
@media screen and (min-width: 400px) and (max-width: 700px) { … } (max-width: 700px) { … }
MediaQueri.es
DEBUG 开发第四步
移动调试 • Chrome 开发者工具 • 远程调试 – Edge Inspect –
Edge Inspect – Weinre – iWebInspector • 多设备 / 多浏览器测试
书籍推荐
THANKS! @adamlu