75
MOBILE APP DEVELOPMENT WITH Ti Accelerated WYNNNETHERLAND

Accelerated Native Mobile Development with the Ti gem

Embed Size (px)

DESCRIPTION

The Ti gem lets you build Titanium mobile apps better, using Ruby to stich together a polyglot approach using CoffeeScript, Compass, and Sass.

Citation preview

Page 1: Accelerated Native Mobile Development with the Ti gem

MOBILE APP DEVELOPMENT WITH TiAccelerated

WYNNNETHERLAND

Page 2: Accelerated Native Mobile Development with the Ti gem
Page 3: Accelerated Native Mobile Development with the Ti gem

D'oh! Sorry, will have to blind you with science.

Page 7: Accelerated Native Mobile Development with the Ti gem

And you are?

Page 8: Accelerated Native Mobile Development with the Ti gem

So you wanna build a mobile app?

Page 9: Accelerated Native Mobile Development with the Ti gem
Page 10: Accelerated Native Mobile Development with the Ti gem

Native vs. Web

Page 11: Accelerated Native Mobile Development with the Ti gem

Why native?

Page 13: Accelerated Native Mobile Development with the Ti gem
Page 14: Accelerated Native Mobile Development with the Ti gem
Page 15: Accelerated Native Mobile Development with the Ti gem
Page 16: Accelerated Native Mobile Development with the Ti gem
Page 17: Accelerated Native Mobile Development with the Ti gem
Page 18: Accelerated Native Mobile Development with the Ti gem
Page 19: Accelerated Native Mobile Development with the Ti gem

Obj C Java

Page 20: Accelerated Native Mobile Development with the Ti gem

Titanium

Page 21: Accelerated Native Mobile Development with the Ti gem
Page 22: Accelerated Native Mobile Development with the Ti gem

SINGLE JAVASCRIPT API

Page 23: Accelerated Native Mobile Development with the Ti gem

COMPILES TO NATIVE CODE

Page 24: Accelerated Native Mobile Development with the Ti gem
Page 25: Accelerated Native Mobile Development with the Ti gem

OPEN SOURCE!http://github.com/appcelerator/titanium_mobile

Page 26: Accelerated Native Mobile Development with the Ti gem

Development options

Page 27: Accelerated Native Mobile Development with the Ti gem
Page 28: Accelerated Native Mobile Development with the Ti gem

I’d rather not use your IDE.After fleeing .NET for the joys of Ruby

Page 29: Accelerated Native Mobile Development with the Ti gem

Fortunately, there’s a CLI.

Page 30: Accelerated Native Mobile Development with the Ti gem

DEMOA quick

Page 31: Accelerated Native Mobile Development with the Ti gem

Fortunately, there’s a CLI.Unfortunately, it’s written in Python.

Page 32: Accelerated Native Mobile Development with the Ti gem

Why should I care?I’m a Rubyist

Page 33: Accelerated Native Mobile Development with the Ti gem

You'll still need a server APIRails, Sinatra, etc.

Page 34: Accelerated Native Mobile Development with the Ti gem

Embrace your inner polyglot.

Page 35: Accelerated Native Mobile Development with the Ti gem

COFFEESCRIPT

Page 36: Accelerated Native Mobile Development with the Ti gem

var foo = function () {

}foo = () ->

I’d rather write this.

Page 37: Accelerated Native Mobile Development with the Ti gem

var button = Titanium.UI.createButton({ title: 'I am a Button', height: 40, width: 200, top: 10});

button.addEventListener('click', function(e) { alert("Oooh, that tickles!");});

JavaScript

Page 38: Accelerated Native Mobile Development with the Ti gem

button = Titanium.UI.createButton title: 'I am a Button' height: 40 width: 200 top: 10

button.addEventListener 'click', (e) -> alert "Oooh, that tickles!"

CoffeeScript

Page 39: Accelerated Native Mobile Development with the Ti gem

JavaScript Frameworks

Page 40: Accelerated Native Mobile Development with the Ti gem

Underscore.jshttps://github.com/documentcloud/underscore

Page 41: Accelerated Native Mobile Development with the Ti gem

STYLESHEETS

Page 42: Accelerated Native Mobile Development with the Ti gem

var buttonOne = Titanium.UI.createButton({ title:'I am a Button', height:40, width:200, top:10});

var buttonTwo = Titanium.UI.createButton({ title:'I am also a Button', image:'../images/chat.png', width:200, height:40, top:60});

Page 43: Accelerated Native Mobile Development with the Ti gem

// jsvar buttonOne = Titanium.UI.createButton({ id: "buttonOne", className: "button"});

var buttonTwo = Titanium.UI.createButton({ id: "buttonTwo", className: "button"});

// jss#buttonOne { title:'I am a Button'; width:200; height:40; top:10}#buttonTwo { title:'I am also a Button'; image:'../images/chat.png'; width:200; height:40; top:60}.button { height: 40; width: 200;}

Page 44: Accelerated Native Mobile Development with the Ti gem

JSS work like CSS.

Page 45: Accelerated Native Mobile Development with the Ti gem

But I don't even like CSS.

Page 46: Accelerated Native Mobile Development with the Ti gem

SASS & COMPASSFortunately, there's

Page 47: Accelerated Native Mobile Development with the Ti gem

#buttonOne { title: 'I am a Button'; width: 200; height: 40; top: 10}#buttonTwo { title: 'I am also a Button'; image: '../images/chat.png'; width: 200; height: 40; top: 60}.button { height: 40; width: 200;}

Page 48: Accelerated Native Mobile Development with the Ti gem

#buttonOne title: 'I am a Button' width: 200 height: 40 top: 10

#buttonTwo title: 'I am also a Button' image: '../images/chat.png' width: 200 height: 40 top: 60

.button height: 40 width: 200

Page 49: Accelerated Native Mobile Development with the Ti gem

=button height: 40 width: 200

#buttonOne +button title: 'I am a Button' top: 10

#buttonTwo +button title: 'I am also a Button' image: '../images/chat.png' top: 60

Page 50: Accelerated Native Mobile Development with the Ti gem

RubyOh yeah, and there's

Page 51: Accelerated Native Mobile Development with the Ti gem

CODE DEEP DIVE

Page 52: Accelerated Native Mobile Development with the Ti gem

Ti GEM

Page 53: Accelerated Native Mobile Development with the Ti gem

gem install ti

Page 54: Accelerated Native Mobile Development with the Ti gem

Generate.

Page 55: Accelerated Native Mobile Development with the Ti gem

ti new <name> <id> <platform>

Page 56: Accelerated Native Mobile Development with the Ti gem

ti new lsrc com.lonestarrubyconf.v iphone

Page 57: Accelerated Native Mobile Development with the Ti gem

├── Coffeefile├── Guardfile├── LICENSE├── Rakefile├── Readme.mkd├── Resources│   ├── app.js│   ├── app.jss│   ├── images│   │   ├── KS_nav_ui.png│   │   └── KS_nav_views.png│   ├── lsrc.js│   └── vendor├── app│   ├── app.coffee│   └── lsrc│   ├── api.coffee│   ├── app.coffee│   ├── helpers│   │   └── application.coffee│   ├── models│   ├── stylesheets│   │   ├── app.sass│   │   └── partials│   └── views├── build├── config│   └── config.rb├── docs├── spec│   ├── app_spec.coffee│   ├── helpers│   ├── models│   └── views

Page 58: Accelerated Native Mobile Development with the Ti gem

ti generate <model/controller/view> <name>

Page 59: Accelerated Native Mobile Development with the Ti gem

Golf.Views.GamePlay.createScoreCardView = (options) -> view = Ti.UI.createView (options) view

Page 60: Accelerated Native Mobile Development with the Ti gem

ti scaffold <window/tabgroup/view> <domain> <name>

Page 61: Accelerated Native Mobile Development with the Ti gem

Compile.

Page 62: Accelerated Native Mobile Development with the Ti gem

ti compile <all/coffee/sass>

Page 63: Accelerated Native Mobile Development with the Ti gem

Build.

Page 64: Accelerated Native Mobile Development with the Ti gem

ti build <all/iphone/android/ipad/desktop/>

Page 66: Accelerated Native Mobile Development with the Ti gem

Get involved!

Page 67: Accelerated Native Mobile Development with the Ti gem

Testing.

Page 68: Accelerated Native Mobile Development with the Ti gem

Jasmine

Page 69: Accelerated Native Mobile Development with the Ti gem

Jasminehttps://github.com/akahigeg/jasmine-titanium

Page 70: Accelerated Native Mobile Development with the Ti gem

XIB

Page 71: Accelerated Native Mobile Development with the Ti gem

xib2jshttps://github.com/daoki2/xib2js

Page 72: Accelerated Native Mobile Development with the Ti gem

js2coffeehttp://ricostacruz.com/js2coffee/

Page 73: Accelerated Native Mobile Development with the Ti gem

QUESTIONS?

Page 75: Accelerated Native Mobile Development with the Ti gem

@pengwynn