SlideShare a Scribd company logo
An introduction
to Titanium
Enough to get you into trouble
Graham Weldon

  PHP developer for 11 years

  CakePHP core contributor

  Open source public speaker

  Love developing/teaching



  @predominant

  http://grahamweldon.com

  http://cakedc.com
The rise of mobile

  Making, distributing and selling mobiles apps can be
  a lucrative business

  Well designed, available apps are sought after

  Users prefer a service or product if it comes with a
  mobile counterpart

  Mobile

      Available

      Accessible

      Offline
Mobile history

  PDA’s

  Original Netbooks

  Symbian (Nokia domination)

  iMode (Success in Japan)

  WAP

  Java ME

  Android, iOS, Windows Phone, Meego, and more
Building for mobile

  Google Android

     Java

  Apple iOS

     Objective C

  Windows Phone

     .NET platform (C#, primarily)

  Blackberry

     Java
Abstraction Layers
An abstraction layer is a way of
hiding the implementation
details of a particular set of
functionality.
What is an
abstraction layer?
Why use an
abstraction layer?
  Simpler maintenance

      Only working with business logic and custom code

      One codebase, many platforms

  Quicker development

  Re-use existing knowledge

  Less re-training
I’m convinced!
What can I use?
  NimbleKit (iOS)

  Adobe PhoneGap (Web container)

  Adobe Flex / Flash

  Appcelerator Titanium (Compiled to native)

  Corona (Lua)

  Rhomobile

  Web
        jQuery Mobile

        Sencha Touch

        Custom
Appcelerator Titanium
Appcelerator Titanium
An introduction to Titanium
Wait... Free?

  The platform and studio environment cost nothing

  You have all the tools you need to build applications

  Its also Open Source! http://github.com/appcelerator

  Whats the catch?

      Appcelerator is a company for profit

      Support

      Premium modules / extensions

      Custom development
Take advantage of
existing skills
  Web Developers

  Use Javascript

  Learn and extend their knowledge

  Benefit their web skills



  Only the Titanium specific calls are different
Key advantages

  Write once

  Deploy everywhere

  Cut down on maintenance

  Simplify deployment to new platforms
The Titanium Platform
Titanium Studio

  Build apps

  Debug

  Profile

  Code hinting

  Easy device testing

  Easy deployment
How does it work?

  Pre-Compiler

     Optimise, Analyse code

     Find and resolve dependencies

  Front End Compiler

     Convert to native code

     Package in JS engine for other stuff

  Platform Compiler

     Compiled with native tools

     Xcode + iOS SDK, Java + Android SDK
What does that mean?

  Its optimising your code

  Converting what it can to native device code

  Anything it can’t gets run through the JS Engine

  Makes it super fast

  Makes it super portable no matter the code
Javascript!
An introduction to Titanium
A perfect match

  Titanium is

      View driven

      Event based

  Perfect for Javascript

  Layered view hierarchy

      Similar to iOS
Organising and
building your app
Resources

  The resources folder

  Holds all the important stuff

  Code

  Assets

  Platform specific whatsits
Platforms

  Sometimes platforms have
  differences

  You need to occasionally
  provide a different
  implementation

  Maybe some images for just that
  platform
iPhone folder

  appicon.png
      Icon for home screen

  *-Landscape.png
      Landscape splash image

  *-Portrait.png
      Portrait splash image

  Default.png
      Standard resolution

  Default@2x.png

      Double resolution (iPhone4+)
and of course... Android
app.js


          Code Context
           Separate context to keep things
           tidy and manageable

           ‘myVar’ in app.js

           Not accessible in win1.js

           Use globals sparingly


win1.js
But I want global
data, configs, etc..
  Define configuration files

  Use the Titanium Include

      Ti.include(...);

  Separate different information

  Only include what you need
UI Structure
Tabbed Layout

  Very common

      iOS Examples: Twitter app, Foursquare, Commbank,
      Phone

  One window per tab

  Tab windows can open sub-windows

      Naturally they get a “< back” option

  Easy to use and understand

  No effort required!
An introduction to Titanium
An introduction to Titanium
An introduction to Titanium
Doh! Platform differences

  iOS has tabs at the bottom

  Android has tabs at the top



  iOS has a title by default for tabGroups

  Android doesn’t have a title for tabGroups



  More than likely your creative director wants everything
  to look the same on all platforms

  Disregarding previous user epxerience on specific
  platforms.
An introduction to Titanium
There are workarounds!
An introduction to Titanium
Custom Interfaces
Possible.

But requires some real work.
Manage your UI
Interface stacking

Order, and backtracking
An introduction to Titanium
Exciting! But scary...
Titanium makes it easy
Ti.Accelerometer

  addEventListener

  removeEventListener

  fireEvent

     Simulate accelerometer events
Ti.Geolocation

  Quick and easy Geo

  Current Position

  forwardGeocoder

      Address -> Coords

  reverseGeocoder

      Coords -> Address

  Add/remove listeners
Ti.Map

  Common interface for all
  devices

  Simple map integration

  Use with information from
  Ti.Geolocation

  Add custom pins / locations

  Switch map types

      Satellite / Standard / Hybrid
Ti.Analytics

  Monitor events

  Report on them later

  Gather info about behaviour

  Improve your application

  Challenge users
Ti.Contacts

  Access the Address Book

  Works on all devices

  One interface

  Integrate contacts

  Simplify information sharing



  Read only on Android :(
Ti.Database

  A simple to use database

  SQL compliant

  Install and update DBs

  Store local data

  Great for offline storage

  Sync later
Ti.Filesystem

  Read files

  Write files

  iOS restricted to sandbox

      (everyone is...)

  Android allows access to
  external media
Ti.Facebook

  Simple Facebook integration

  REST API (Deprecated)

  Graph API

  Login

  Store authorization

  Simple configuration

  Works everywhere
Ti.Gesture

  Track gestures

  add event listeners

  customise your app UX

  Events

      shake

      orientation change
Ti.Network

  Protocols

      TCP

      HTTP

      Bonjour

  Implement any protocol you
  like on TCP

  Connect your app

  Create a server
Ti.XML

  Easy to use parser

  Produce XML too

  Makes consuming services easy

  Includes things like

      rss

      atom

      oData
Yahoo! YQL

   My personal favourite

   Grab data from anywhere on
   the internet

   Query using XPATH

   Scrape websites (responsibly)




http://developer.yahoo.com/yql/
Commercial
                                Components
                                     There are a heap on the
                                     marketplace

                                     Some are reasonably priced

                                     Great way to get things done
                                     quickly

                                     You can sell your own
                                     components on the marketplace




http://www.appcelerator.com/products/open-mobile-marketplace/
Also check
Github
  Search repos for ‘Titanium’

  Currently 706 results

  Components

  Full projects




  http://goo.gl/R69Ck
JSS
JSS: CSS style rules

  Not much information about it

  But very easy to use

      app.js

      app.jss

  Set almost any property



  Always clean before running your app!
app.js




app.jss
app.js




app.jss
Building your app
Multiple platform support
Optionally select
a template
An introduction to Titanium
< insert coding montage >
Thats it! Thanks!

  Graham Weldon

     http://grahamweldon.com

     @predominant



  Cake Development Corporation

     http://cakedc.com

     @cakedc

More Related Content

KEY
SydPHP May 2012 - Deployment
KEY
Building 3D apps with Javascript
KEY
CakePHP 2.0 - PHP Matsuri 2011
KEY
CakePHP - The Path to 2.0
KEY
Re-imaginging CakePHP
PPS
Moving Pictures - Web 2.0 Expo NYC
PDF
PHP 5.4 - Begin your love affair with traits
PDF
Building Desktop RIAs with JavaScript and PHP - ZendCon09
SydPHP May 2012 - Deployment
Building 3D apps with Javascript
CakePHP 2.0 - PHP Matsuri 2011
CakePHP - The Path to 2.0
Re-imaginging CakePHP
Moving Pictures - Web 2.0 Expo NYC
PHP 5.4 - Begin your love affair with traits
Building Desktop RIAs with JavaScript and PHP - ZendCon09

What's hot (20)

KEY
SydPHP March 2012 Meetup
PPT
Building Big on the Web
PPS
Scalable PHP
PDF
Myphp-busters: symfony framework
PDF
Myphp-busters: symfony framework (PHPCon.it)
PDF
Composer - The missing package manager for PHP
PPTX
SharePoint Development 101
PDF
Desktop Apps with PHP and Titanium
PPTX
Zend con 2016 bdd with behat for beginners
PPTX
Hybrid Mobile Development with Apache Cordova and
KEY
WordPress APIs
PDF
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
PDF
The Power of Refactoring
PPTX
Paragraphs at drupal 8.
PDF
Php Dependency Management with Composer ZendCon 2016
PPTX
Web development with Python
PDF
Stackato v6
PDF
Ako na vlastne WP temy
PPTX
PHP Frameworks, or how I learnt to stop worrying and love the code
PDF
Automate Yo' Self
SydPHP March 2012 Meetup
Building Big on the Web
Scalable PHP
Myphp-busters: symfony framework
Myphp-busters: symfony framework (PHPCon.it)
Composer - The missing package manager for PHP
SharePoint Development 101
Desktop Apps with PHP and Titanium
Zend con 2016 bdd with behat for beginners
Hybrid Mobile Development with Apache Cordova and
WordPress APIs
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
The Power of Refactoring
Paragraphs at drupal 8.
Php Dependency Management with Composer ZendCon 2016
Web development with Python
Stackato v6
Ako na vlastne WP temy
PHP Frameworks, or how I learnt to stop worrying and love the code
Automate Yo' Self
Ad

Viewers also liked (7)

KEY
SydPHP April 2012
PDF
Re-imagining CakePHP (OSDC 2010)
KEY
The business behind open source
KEY
CakePHP and Open Source - Newcastle University
PPTX
Appcelerator Titanium Intro
PDF
Appcelerator Titanium Intro (2014)
PPTX
Appcelerator Titanium - An Introduction to the Titanium Ecosystem
SydPHP April 2012
Re-imagining CakePHP (OSDC 2010)
The business behind open source
CakePHP and Open Source - Newcastle University
Appcelerator Titanium Intro
Appcelerator Titanium Intro (2014)
Appcelerator Titanium - An Introduction to the Titanium Ecosystem
Ad

Similar to An introduction to Titanium (20)

PPT
Titanium Meetup Deck
KEY
SumitK's mobile app dev using drupal as base ststem
PPT
Native Mobile Application Using Open Source
PPT
OSCON Titanium Tutorial
PDF
Building Cross-Platform Mobile Apps
PPT
Titanium Overview (Mobile March 2011)
PPT
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
PPTX
Introduction to building multi platform mobile applications with javascript u...
PPTX
Titanium presentation
PPTX
Primers on mobile application development
PPTX
Cross Platform Mobile Technologies
PPTX
Cross-Platform Development using Angulr JS in Visual Studio
KEY
Idea to Appstore with Titanium Mobile
KEY
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
ZIP
iPhone/iPad Development with Titanium
PPTX
Developing Windows Phone 8 apps using PhoneGap
PDF
Develop an app for Windows 8 using HTML5
PDF
Cordova and PhoneGap Insights
KEY
webOS App by Example: Sorting Thoughts
PPT
Native Mobile Application Using Java Script
Titanium Meetup Deck
SumitK's mobile app dev using drupal as base ststem
Native Mobile Application Using Open Source
OSCON Titanium Tutorial
Building Cross-Platform Mobile Apps
Titanium Overview (Mobile March 2011)
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
Introduction to building multi platform mobile applications with javascript u...
Titanium presentation
Primers on mobile application development
Cross Platform Mobile Technologies
Cross-Platform Development using Angulr JS in Visual Studio
Idea to Appstore with Titanium Mobile
Appcelerator iPhone/iPad Dev Con 2010 San Diego, CA
iPhone/iPad Development with Titanium
Developing Windows Phone 8 apps using PhoneGap
Develop an app for Windows 8 using HTML5
Cordova and PhoneGap Insights
webOS App by Example: Sorting Thoughts
Native Mobile Application Using Java Script

More from Graham Weldon (9)

PDF
HackLang Introduction
PPT
20130714 php matsuri - highly available php
KEY
SydPHP June 2012 - GovHack overview
KEY
MySQL Performance - SydPHP October 2011
KEY
Nginx in production
KEY
CakePHP 2.0 - It'll rock your world
PDF
CakePHP Tutorial - OSDC 2010
PDF
Debugging and Profiling PHP
PDF
OSDC LIghtning Talk - Context Free Art
HackLang Introduction
20130714 php matsuri - highly available php
SydPHP June 2012 - GovHack overview
MySQL Performance - SydPHP October 2011
Nginx in production
CakePHP 2.0 - It'll rock your world
CakePHP Tutorial - OSDC 2010
Debugging and Profiling PHP
OSDC LIghtning Talk - Context Free Art

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Cloud computing and distributed systems.
PDF
Modernizing your data center with Dell and AMD
PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Cloud computing and distributed systems.
Modernizing your data center with Dell and AMD
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

An introduction to Titanium

  • 1. An introduction to Titanium Enough to get you into trouble
  • 2. Graham Weldon PHP developer for 11 years CakePHP core contributor Open source public speaker Love developing/teaching @predominant http://grahamweldon.com http://cakedc.com
  • 3. The rise of mobile Making, distributing and selling mobiles apps can be a lucrative business Well designed, available apps are sought after Users prefer a service or product if it comes with a mobile counterpart Mobile Available Accessible Offline
  • 4. Mobile history PDA’s Original Netbooks Symbian (Nokia domination) iMode (Success in Japan) WAP Java ME Android, iOS, Windows Phone, Meego, and more
  • 5. Building for mobile Google Android Java Apple iOS Objective C Windows Phone .NET platform (C#, primarily) Blackberry Java
  • 7. An abstraction layer is a way of hiding the implementation details of a particular set of functionality.
  • 9. Why use an abstraction layer? Simpler maintenance Only working with business logic and custom code One codebase, many platforms Quicker development Re-use existing knowledge Less re-training
  • 10. I’m convinced! What can I use? NimbleKit (iOS) Adobe PhoneGap (Web container) Adobe Flex / Flash Appcelerator Titanium (Compiled to native) Corona (Lua) Rhomobile Web jQuery Mobile Sencha Touch Custom
  • 14. Wait... Free? The platform and studio environment cost nothing You have all the tools you need to build applications Its also Open Source! http://github.com/appcelerator Whats the catch? Appcelerator is a company for profit Support Premium modules / extensions Custom development
  • 15. Take advantage of existing skills Web Developers Use Javascript Learn and extend their knowledge Benefit their web skills Only the Titanium specific calls are different
  • 16. Key advantages Write once Deploy everywhere Cut down on maintenance Simplify deployment to new platforms
  • 18. Titanium Studio Build apps Debug Profile Code hinting Easy device testing Easy deployment
  • 19. How does it work? Pre-Compiler Optimise, Analyse code Find and resolve dependencies Front End Compiler Convert to native code Package in JS engine for other stuff Platform Compiler Compiled with native tools Xcode + iOS SDK, Java + Android SDK
  • 20. What does that mean? Its optimising your code Converting what it can to native device code Anything it can’t gets run through the JS Engine Makes it super fast Makes it super portable no matter the code
  • 23. A perfect match Titanium is View driven Event based Perfect for Javascript Layered view hierarchy Similar to iOS
  • 25. Resources The resources folder Holds all the important stuff Code Assets Platform specific whatsits
  • 26. Platforms Sometimes platforms have differences You need to occasionally provide a different implementation Maybe some images for just that platform
  • 27. iPhone folder appicon.png Icon for home screen *-Landscape.png Landscape splash image *-Portrait.png Portrait splash image Default.png Standard resolution Default@2x.png Double resolution (iPhone4+)
  • 28. and of course... Android
  • 29. app.js Code Context Separate context to keep things tidy and manageable ‘myVar’ in app.js Not accessible in win1.js Use globals sparingly win1.js
  • 30. But I want global data, configs, etc.. Define configuration files Use the Titanium Include Ti.include(...); Separate different information Only include what you need
  • 32. Tabbed Layout Very common iOS Examples: Twitter app, Foursquare, Commbank, Phone One window per tab Tab windows can open sub-windows Naturally they get a “< back” option Easy to use and understand No effort required!
  • 36. Doh! Platform differences iOS has tabs at the bottom Android has tabs at the top iOS has a title by default for tabGroups Android doesn’t have a title for tabGroups More than likely your creative director wants everything to look the same on all platforms Disregarding previous user epxerience on specific platforms.
  • 41. Manage your UI Interface stacking Order, and backtracking
  • 45. Ti.Accelerometer addEventListener removeEventListener fireEvent Simulate accelerometer events
  • 46. Ti.Geolocation Quick and easy Geo Current Position forwardGeocoder Address -> Coords reverseGeocoder Coords -> Address Add/remove listeners
  • 47. Ti.Map Common interface for all devices Simple map integration Use with information from Ti.Geolocation Add custom pins / locations Switch map types Satellite / Standard / Hybrid
  • 48. Ti.Analytics Monitor events Report on them later Gather info about behaviour Improve your application Challenge users
  • 49. Ti.Contacts Access the Address Book Works on all devices One interface Integrate contacts Simplify information sharing Read only on Android :(
  • 50. Ti.Database A simple to use database SQL compliant Install and update DBs Store local data Great for offline storage Sync later
  • 51. Ti.Filesystem Read files Write files iOS restricted to sandbox (everyone is...) Android allows access to external media
  • 52. Ti.Facebook Simple Facebook integration REST API (Deprecated) Graph API Login Store authorization Simple configuration Works everywhere
  • 53. Ti.Gesture Track gestures add event listeners customise your app UX Events shake orientation change
  • 54. Ti.Network Protocols TCP HTTP Bonjour Implement any protocol you like on TCP Connect your app Create a server
  • 55. Ti.XML Easy to use parser Produce XML too Makes consuming services easy Includes things like rss atom oData
  • 56. Yahoo! YQL My personal favourite Grab data from anywhere on the internet Query using XPATH Scrape websites (responsibly) http://developer.yahoo.com/yql/
  • 57. Commercial Components There are a heap on the marketplace Some are reasonably priced Great way to get things done quickly You can sell your own components on the marketplace http://www.appcelerator.com/products/open-mobile-marketplace/
  • 58. Also check Github Search repos for ‘Titanium’ Currently 706 results Components Full projects http://goo.gl/R69Ck
  • 59. JSS
  • 60. JSS: CSS style rules Not much information about it But very easy to use app.js app.jss Set almost any property Always clean before running your app!
  • 63. Building your app Multiple platform support
  • 66. < insert coding montage >
  • 67. Thats it! Thanks! Graham Weldon http://grahamweldon.com @predominant Cake Development Corporation http://cakedc.com @cakedc