Upgrade to Pro — share decks privately, control downloads, hide ads and more …

一步一步开发HTML5 Mobile Apps

Adam Lu
January 24, 2013

一步一步开发HTML5 Mobile Apps

Adam Lu

January 24, 2013
Tweet

More Decks by Adam Lu

Other Decks in Technology

Transcript

  1. 为什么要开发 HTML5 Web Apps • 跨系统 / 平台 / 浏览器

    • 易扩展 • 跨设备开发减少成本
  2. 基于 HTML5 应用之服务器端架构 • 可以和传统的 Web 架构类似 ( 浏览器不关心 )

    • 可以考虑使用 REST 设计, JavaScript 加载和 管理状态 管理状态
  3. 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 新标签
  4. 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
  5. 媒体查询 • @media all and (min-width:500px) { … } •

    @media screen and (min-width: 400px) and (max-width: 700px) { … } (max-width: 700px) { … }
  6. 移动调试 • Chrome 开发者工具 • 远程调试 – Edge Inspect –

    Edge Inspect – Weinre – iWebInspector • 多设备 / 多浏览器测试