Slide 1

Slide 1 text

Titanium Develop Native Mobile Apps with JavaScript Fokke Zandbergen @FokkeZB

Slide 2

Slide 2 text

Appcelerator Developer Evangelist @FokkeZB NL Freelance App Developer Try Share Improve gitT.io TiCons

Slide 3

Slide 3 text

WOW! I can use my skills to build truly native  apps!

Slide 4

Slide 4 text

NO!

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Wrapped HTML Apps polling JSON “localhost” XMLHttpRequest  system APIs !

Slide 7

Slide 7 text

“The Bottleneck”

Slide 8

Slide 8 text

It just feels “sticky”

Slide 9

Slide 9 text

iOS TabGroup? Android Drawer? Uh?!

Slide 10

Slide 10 text

 JS 2 Native Apps JSCore/V8 APIs system APIs UIKit etc.

Slide 11

Slide 11 text

 V8 APIs system APIs We’re not alone

Slide 12

Slide 12 text

var text = Ti.UI.createLabel({ text: "Hello, world!", font: { fontSize: 60 }, color: 'red' }); var window = Ti.UI.createWindow(); window.add(text); window.open();

Slide 13

Slide 13 text

var text = Ti.UI.createLabel({ text: 'Hello, world!', font: { fontSize: 60 }, color: 'red', focusable: true }); var window = Ti.UI.createWindow(); if (Ti.Platform.name === 'android') { window.add(Ti.UI.Android.createProgressIndicator()); } window.add(text); window.open(); Platform-specific code

Slide 14

Slide 14 text

“The Bridge”

Slide 15

Slide 15 text

var blur = require('bencoding.blur'); var view = blur.createBasicBlurView({ blurRadius: 5, image: '/images/background.png' }); var window = Ti.UI.createWindow(); window.add(view); window.open(); Modules 

Slide 16

Slide 16 text

“The Boat”

Slide 17

Slide 17 text

 var Hyperloop = require("hyperloop"); var TiApp = require("TiApp"); var UIViewController = require("UIViewController"); var UILabel = require("UILabel"); var UIColor = require("UIColor"); var UIScreen = require("UIScreen"); var CGRect = require("CGRect"); var NSTextAlignment = require("NSTextAlignment"); var label = UILabel.initWithFrame(CGRect.Make(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height )); label.setText('Hello World!'); label.setTextColor(UIColor.redColor()); var viewController = UIViewController.init(); viewController.view.setBackgroundColor(UIColor.whiteColor()); viewController.view.addSubview(label); TiApp.app().showModalController(viewController, false); Hyperloop for iOS

Slide 18

Slide 18 text

 var Hyperloop = require("hyperloop"); var TiApp = require("TiApp"); var UIViewController = require("UIViewController"); var UILabel = require("UILabel"); var UIColor = require("UIColor"); var UIScreen = require("UIScreen"); var CGRect = require("CGRect"); var NSTextAlignment = require("NSTextAlignment"); var label = UILabel.initWithFrame(CGRect.Make(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height )); label.setText('Hello World!'); label.setTextColor(UIColor.redColor()); var viewController = UIViewController.init(); viewController.view.setBackgroundColor(UIColor.whiteColor()); viewController.view.addSubview(label); TiApp.app().showModalController(viewController, false); Hyperloop for iOS

Slide 19

Slide 19 text

var text = Ti.UI.createLabel({ text: "Hello, world!", font: { fontSize: 60 }, color: 'red' }); var window = Ti.UI.createWindow(); window.add(text); window.open();

Slide 20

Slide 20 text

var Window = require('Windows.UI.Xaml.Window'), TextBlock = require('Windows.UI.Xaml.Controls.TextBlock'), Colors = require('Windows.UI.Colors'), SolidColorBrush = require('Windows.UI.Xaml.Media.SolidColorBrush'); var text = new TextBlock(); text.Text = 'Hello, world!'; text.FontSize = 50; text.Foreground = new SolidColorBrush(Colors.Red); var window = Window.Current, window.Content = text; window.Activate(); Hyperloop for Windows

Slide 21

Slide 21 text

var TextView = require('android.widget.TextView'), Activity = require('android.app.Activity'), Color = require('android.graphics.Color'), RelativeLayout = require('android.widget.RelativeLayout'), Gravity = require('android.view.Gravity'), TypedValue = require('android.util.TypedValue'); var text = new TextView(activity); text.setText("Hello World!"); text.setTextColor(Color.RED); text.setTextSize(TypedValue.COMPLEX_UNIT_PX, 60); var layout = new RelativeLayout(activity); layout.setGravity(Gravity.CENTER); layout.setBackgroundColor(Color.BLACK); layout.addView(text); var activity = new Activity(Ti.Android.currentActivity); activity.setContentView(layout); Hyperloop for Android

Slide 22

Slide 22 text

Spaghetti code

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

var text = Ti.UI.createLabel({ text: "Hello, world!", font: { fontSize: 60 }, color: 'red' }); var window = Ti.UI.createWindow(); window.add(text); window.open();

Slide 25

Slide 25 text

Hello, world! 'Label': { font: { fontSize: 60 }, color: 'red' } $.index.open(); index.xml index.tss index.js

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Hello, world! 'Window[formFactor=tablet]': { backgroundColor: 'green' } if (ENV_TEST) { $.index.open(); } Conditional Code

Slide 28

Slide 28 text

Widgets Hello, world! index.xml widgets/hello

Slide 29

Slide 29 text

Let’s play..

Slide 30

Slide 30 text

Apps alone won’t cut it

Slide 31

Slide 31 text

You need Triple

Slide 32

Slide 32 text

You need Triple appcelerator.com

Slide 33

Slide 33 text

✓ Native UI… NO HTML ✓ Cross Platform JS API ✓ Direct API Access ✓ Alloy MVC framework ✓ Modules & Widgets ✓ You need Tripple

Slide 34

Slide 34 text

I can use my skills to build truly native  apps! WOW!

Slide 35

Slide 35 text

Thank you Thanks to Ryan McGuire for the photo’s @bellsdesign Fokke Zandbergen @FokkeZB