Transcript
Page 1: Sencha touch在移动设备的应用

Sencha Touch在移动设备的应用

悠乐无线 @三桥 sankyu

[email protected]://www.imsankyu.com

Page 2: Sencha touch在移动设备的应用

HTML5

Page 3: Sencha touch在移动设备的应用

动画、游戏视频应用移动应用 Web App

离线应用地理定位用户体验

Page 4: Sencha touch在移动设备的应用

iUI http://code.google.com/p/iui/

PhoneGap http://www.phonegap.com/

Sencha Touch http://www.sencha.com/

Web 移动应用 JS 框架

jQuery Mobile http://jquerymobile.com/

Page 5: Sencha touch在移动设备的应用

What’s Sencha Touch?

Page 6: Sencha touch在移动设备的应用

a JavaScript framework for building rich mobile apps with web standards

What’s Sencha Touch?

Page 7: Sencha touch在移动设备的应用
Page 8: Sencha touch在移动设备的应用

Why Sencha Touch?

Page 9: Sencha touch在移动设备的应用

Why Sencha Touch?

Built with Web Standards

Cross-platform

Looks native, feels native

Flexible Deployment

Highly customisable

The World’s Best Devices

Page 10: Sencha touch在移动设备的应用

Features

Page 11: Sencha touch在移动设备的应用

FeaturesEnhanced Touch Events

Data Integration

GEO 、 Map

Video 、 Audio

Scrolling

Froms

Components

More…

Page 12: Sencha touch在移动设备的应用

Touch EventsTap

Double tap

Tap and hold

Swipe

Rotate

pinch

Drag & drop

Page 13: Sencha touch在移动设备的应用

Data IntegrationModels , Stores , Proxies

• Associations• Validation• Local & server storage

Easily consume web services• JSON/P

• XML• YQL

Page 14: Sencha touch在移动设备的应用

ScrollingMomentum/bounce physics

Hardware accelerated

Throughout components

Lists

Carousel

Pickers

Page 15: Sencha touch在移动设备的应用

FormsHTML5

Email

URL

Number

Toggle

Slider

spinner

Page 16: Sencha touch在移动设备的应用

ComponentsPanel

Lists Nested, Grouped, Sortable

Layout

Picker

Overlay

Toolbars & buttons

HTML5 Audio,Video,GeoLocation

Page 17: Sencha touch在移动设备的应用

Hello World!

Page 18: Sencha touch在移动设备的应用

Index.html

<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>hello world</title><link rel="stylesheet" type="text/css" href=“sencha-touch.css" /><script type="text/javascript" src=“sencha-touch.js"></script><script type="text/javascript" src=“demo.js"></script></head><body></body></html>

Page 19: Sencha touch在移动设备的应用

demo.js

Ext.setup({onReady: function(){

var panel = new Ext.Panel({fullscreen: true,html:'hello World'

});}

});

Page 20: Sencha touch在移动设备的应用

Sencha MVCModels, Views & Controllers

Page 21: Sencha touch在移动设备的应用

Manages the data of the application

Provide data in its current state

Allows you to change state

Model

ControllerView

Model

Page 22: Sencha touch在移动设备的应用

Ext.regModel("message",{fields : [

{name : 'id',type : 'string'},{name : 'title',type : 'string'},{name : 'content',type : 'string'},{name : 'author',type : 'string'},{name : 'email',type : 'string'},{name : 'url',type : 'string'}

]});

Ext.regStore("messageStore",{model : "message"

});

Page 23: Sencha touch在移动设备的应用

Multiple views can exist for a single model

Views

Renders the model into a form suitable for interaction

Model

ControllerView

Page 24: Sencha touch在移动设备的应用

app.views.Viewport = Ext.extend(Ext.Panel,{id : 'viewport',fullscreen : true,initComponent : function(){ ……}

});

Page 25: Sencha touch在移动设备的应用

Receives input

Instructs the model and views

Controllers

Model

ControllerView

Page 26: Sencha touch在移动设备的应用

new Ext.Controller({model : ‘message',onSelected : function(selectionModel,records){

……},show : function(){

……},save : function(){

……}

});

Page 27: Sencha touch在移动设备的应用

Demos

Page 28: Sencha touch在移动设备的应用

站点推荐

Page 29: Sencha touch在移动设备的应用

http://www.sencha.com/products/touch/

Sencha Touch

http://www.sencha.com/forum/

Sencha Touch forum

Sencha touch 开发指南http://ued.sina.com/?p=406

A Sencha Touch MVC application with PhoneGaphttp://extensions.extjs.com/learn/Tutorial:A_Sencha_Touch_MVC_application_with_PhoneGap

Page 30: Sencha touch在移动设备的应用

OVER