Slide 1

Slide 1 text

Multi-platform mobile development with Titanium + Alloy

Slide 2

Slide 2 text

About me Have been using Titanium since late 2009 Former Titanium trainer in the Caribbean and Latin America Obsessed with cross-platform mobile develoment Love Javascript hacking and technology startups I'm a hacker in constant training

Slide 3

Slide 3 text

About Appcelerator and Titanium JavaScript SDK to develop native, cross-platform mobile apps 500,000+ developers worldwide Titanium is free and Open Source Supports iOS, Android, Blackberry 10, Tizen and Windows in the works The Appcelerator Platform is the enterprise-grade suite of products based on Titanium

Slide 4

Slide 4 text

What do I mean by cross- platform? To understand the power of Titanium, we first need to understand the problem Titanium solves

Slide 5

Slide 5 text

Is a Web-app cross-platform? Let's use Facebook® as example

Slide 6

Slide 6 text

Is a Web-app cross-platform? A web-app is cross-platform only if we define a cross-platform app as an app that can run on multiple platforms

Slide 7

Slide 7 text

Cross-platform is much more than running on different platforms All platforms have their own set of NATIVE UI elements and UX patterns

Slide 8

Slide 8 text

Building native mobile apps the traditional way is not trivial

Slide 9

Slide 9 text

Objective-C (iOS) U I B u t t o n * m y B u t t o n = [ U I B u t t o n b u t t o n W i t h T y p e : U I B u t t o n T y p e R o u n d e d R e c t ] ; [ m y B u t t o n s e t T i t l e : @ " C l i c k M e ! " f o r S t a t e : U I C o n t r o l S t a t e N o r m a l ] ;

Slide 10

Slide 10 text

Java (Android) B u t t o n m y B u t t o n = n e w B u t t o n ( t h i s ) ; m y B u t t o n . s e t T e x t ( " C l i c k M e ! " ) ;

Slide 11

Slide 11 text

Titanium solves this problem by offering a JavaScript SDK that normalizes the underlying SDKs

Slide 12

Slide 12 text

Titanium/JavaScript (iOS, Android) v a r m y B u t t o n = T i . U I . c r e a t e B u t t o n ( { t i t l e : ' C l i c k M e ! ' } )

Slide 13

Slide 13 text

Alloy is Titanium's MVC framework that uses XML, TSS (like CSS) and JavaScript

Slide 14

Slide 14 text

Titanium/Alloy (iOS, Android) < A l l o y > < B u t t o n > C l i c k M e ! < / B u t t o n > < / A l l o y >

Slide 15

Slide 15 text

Alloy App Folder Structure

Slide 16

Slide 16 text

Sample Two-tab App

Slide 17

Slide 17 text

UI DEFINITION: INDEX.XML < a l l o y > < t a b g r o u p i d = " w i n " > < t a b t i t l e = " T a b 1 " i c o n = " K S _ n a v _ u i . p n g " > < w i n d o w t i t l e = " T a b 1 " > < l a b e l c l a s s = " m y l a b e l " > I a m W i n d o w 1 < / l a b e l > < / w i n d o w > < / t a b > < t a b t i t l e = " T a b 2 " i c o n = " K S _ n a v _ v i e w s . p n g " > < w i n d o w t i t l e = " T a b 2 " > < l a b e l c l a s s = " m y l a b e l " > I a m W i n d o w 2 < / l a b e l > < / w i n d o w > < / t a b > < / t a b g r o u p > < / a l l o y >

Slide 18

Slide 18 text

UI STYLING: INDEX.TSS " W i n d o w " : { b a c k g r o u n d C o l o r : " # f f f " } , " L a b e l " : { w i d t h : T i . U I . S I Z E , h e i g h t : T i . U I . S I Z E , c o l o r : " # 0 0 0 " , f o n t : { f o n t S i z e : 2 0 , f o n t F a m i l y : ' H e l v e t i c a N e u e ' } , t e x t A l i g n : ' c e n t e r ' } , " # w i n " : { t o p : 0 , l e f t : 0 } , " . m y l a b e l " : { c o l o r : " # 0 0 0 " }

Slide 19

Slide 19 text

Running on iOS 6

Slide 20

Slide 20 text

Running on iOS 7

Slide 21

Slide 21 text

Running on Android 2.x

Slide 22

Slide 22 text

Running on Android ICS - Holo Dark

Slide 23

Slide 23 text

Running on Android ICS - Holo Light

Slide 24

Slide 24 text

Dealing with native UI elements from the same code- base

Slide 25

Slide 25 text

Simple single-window app

Slide 26

Slide 26 text

INDEX.XML

Slide 27

Slide 27 text

INDEX.TSS

Slide 28

Slide 28 text

INDEX.JS

Slide 29

Slide 29 text

The vocabulary is well documented http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Window

Slide 30

Slide 30 text

View the Source https://github.com/appcelerator/KitchenSink/tree/master/Resources

Slide 31

Slide 31 text

Built into Alloy Backbone Data-binding Synchronization adapters Underscore.js Moment.js Widgets Themes

Slide 32

Slide 32 text

More cool stuff from Appcelerator ACS - Appcelerator Cloud Services Node.ACS Command-line interface (CLI)

Slide 33

Slide 33 text

Get started today! Runs on Mac, Windows and Linux iOS development requires a Mac Requires installation and configuration of all native tools (Xcode, Android SDK manager, etc) Download Titanium Studio from my.appcelerator.com Start hacking!

Slide 34

Slide 34 text

Thank you! Questions? Follow me on Twitter: @ricardoalcocer Github: /ricardoalcocer