sencha touch 2

60
4Developers (Poznan, Poland) / April 18th 2012 Martin de Keijzer Building mobile web applications with Sencha Touch 2 woensdag 18 april 12

Upload: martin-de-keijzer

Post on 09-May-2015

2.008 views

Category:

Technology


0 download

DESCRIPTION

Sencha Touch 2 @ 4Developers (Poznan, Poland)

TRANSCRIPT

4Developers (Poznan, Poland) / April 18th 2012Martin de Keijzer

Building mobile web applicationswith Sencha Touch 2

woensdag 18 april 12

About me

Martin de Keijzer

Dutch web developer

2

@Martin1982

PHPBenelux Board Member

Working for Ibuildings

http://www.martindekeijzer.nl

woensdag 18 april 12

Why mobile?

3woensdag 18 april 12

Apps

LanguagesApple: Objective-C

Android: Java

Windows Phone: C# / Visual Basic

4

Distribution MethodsApple: AppStore

Android: Market

Windows Phone: Microsoft Market Place

woensdag 18 april 12

Web Apps

Available through the web

Platform independent

Can be transformed to an App-like experience

Can be wrapped as native apps

5woensdag 18 april 12

woensdag 18 april 12

The Sencha Touch way

Building applications, not websites

Pure JavaScript

Touch framework

MV(S)C Paradigm

Based on ExtJS 4

Downloadable from http://www.sencha.com

7woensdag 18 april 12

Getting started

8woensdag 18 april 12

Quick start: Sencha Command

9

sencha generate app <name> <path>

woensdag 18 april 12

Quick start: Sencha Command

10

•App

•Resources

•SDK (DO NOT TOUCH!)

•app.js

•.json files

•index.html

woensdag 18 april 12

Quick Start: Sencha Command

11

Webkitwoensdag 18 april 12

User interface

Abstraction of various app-interface ui elements:containers

panels

tabpanels

carousels

lists

forms

toolbars

12woensdag 18 april 12

Creating views

13

app/view/Pictures.js

woensdag 18 april 12

Creating views

14woensdag 18 april 12

Creating views

15

/app.js

woensdag 18 april 12

Creating views

16

app/view/Main.js

woensdag 18 april 12

Creating views

17woensdag 18 april 12

Creating views

17woensdag 18 april 12

Taking control

18woensdag 18 april 12

Bootstrapping and Controllers

19

/app.jsFinal point of bootstrapping, controllers & profiles go first

woensdag 18 april 12

Bootstrapping and Controllers

20woensdag 18 april 12

Events

21

Make the component selectable

Create a new controller

woensdag 18 april 12

Events

22

app/controller/PictureBox.js

woensdag 18 april 12

Events

23

app/controller/PictureBox.js

woensdag 18 april 12

Events

24

Querying

Predefined events

woensdag 18 april 12

Events

25woensdag 18 april 12

Data Communication

26woensdag 18 april 12

Data communication

27woensdag 18 april 12

Model

28

Model

Field

Association Validation

woensdag 18 april 12

Model

29

app/model/Talk.js

woensdag 18 april 12

Store

30

Store

Model

Filter Grouper Sorter

woensdag 18 april 12

Store

31

app/store/Schedule.js

app.js

woensdag 18 april 12

Proxy

32

Proxy

Reader Writer

Store Model

woensdag 18 april 12

Proxy

33

app/model/Talk.js

woensdag 18 april 12

Create a list

34

app/view/Schedule.js

woensdag 18 april 12

Create a list

35

app.js

woensdag 18 april 12

Create a list

36

app/view/Main.js

woensdag 18 april 12

Data in action!

37woensdag 18 april 12

Device profiles

38woensdag 18 april 12

Device profiles

Different devices require different options.

Tablet has more screen real estate and can provide more user interaction than a phone.

Sencha Touch 2 provides profiles to build concrete implementations of the device functionalities.

39woensdag 18 april 12

Profile setup

40woensdag 18 april 12

Profile overriding

41

app/controller/phone/PictureBox.js

app/controller/tablet/PictureBox.js

woensdag 18 april 12

Profile overriding

42

app/profile/Phone.js

woensdag 18 april 12

Profile overriding

43

Desktop

woensdag 18 april 12

Profile overriding

44

Phone

woensdag 18 april 12

Profile overriding

45

Tablet

woensdag 18 april 12

Theme editing

46woensdag 18 april 12

woensdag 18 april 12

Installing Compass

48

gem install compass

woensdag 18 april 12

The scss file

49

compass compile

compass watch

Extension: .scss

woensdag 18 april 12

The scss file

50woensdag 18 april 12

Compass Variables

51

sdk/resources/themes/stylesheets/sencha-touch/

default/_variables.scss

woensdag 18 april 12

Compass Mixins

52woensdag 18 april 12

Tips and conclusions

53woensdag 18 april 12

Quick Tips

•Well documented on http://docs.sencha.com

•Sencha Command

•Sencha Designer 2 Beta

•Keep your views clean, use controllers!

•Mobile devices have limited hardware

54woensdag 18 april 12

Need another look?

55

http://www.github.com/Martin1982/4Developers

woensdag 18 april 12

Hungry for more?????

56

June 7 - 8 - 9, 2012Amsterdam RAI (The Netherlands)

http://mobileconference.nlDutch PHP Conference visitors can attend the mobile conference and vice versa!

woensdag 18 april 12

Questions ?

57woensdag 18 april 12

Thank you!

Contact details:

Twitter: @[email protected]

woensdag 18 april 12

Debugging explained

59

Bonus!

woensdag 18 april 12