1
Before You Begin
•
Prerequisite Software
–
Latest iPhone SDK
–
Android SDK with 1.6 and any later SDKs installed
–
Titanium Developer
•
Getting Started Guide
–
/>arted
–
Linked in tutorial notes at
2
Native Mobile
Applications USING
Open Source
3
Want to give this talk?
•
Your local user group
•
Your company
•
To your wife and kids
•
Package includes:
–
Slides in various formats
–
Example code
–
Resources for presenters
/>4
Today’s Agenda
•
Titanium Mobile Overview
•
Hello World and Project Walkthrough
•
Building Titanium Apps: Fundamentals
•
Code By Numbers: Oh Snap!
•
Where To Go From Here
•
Questions and Answers
•
Independent Hacking
5
About Me
Kevin Whinnery
Engineer/Platform Evangelist
Twitter: @kevinwhinnery
Web developer by trade and training, lover of
JavaScript and open web technologies in general
6
About Appcelerator
•
Open Source Software Company based in Mountain
View
•
~25 employees and growing
•
Developing Titanium for about two years, with
Mobile coming in the last year
•
95% Developers
7
About You
New To Mobile Development Mobile Dev Veteran
8
Either way, you’ve come
to the right place.
9
Amazing Mobile
Platforms
10
Which is great and
exciting!
11
only how do we target
all these cool platforms?
12
Well, you could build
native, but
•
Which platforms do you choose?
•
How many codebases do you want to (or even can you) support?
•
How long will it take to build native on N platforms?
•
How much effort will be duplicated?
•
What if you bet on the wrong platform?
•
Who writes the code? Hire out? Retrain/retool yourself or your devs?
13
The Web Is An Option
•
and should be preferred when feasible
•
Mobile browsers are progressing fast and converging around WebKit
•
But there are limitations
•
Native apps are inherently more capable than web apps
•
Native apps run faster and smoother on resource constrained devices
14
Ideally, we build cross-
platform native apps
15
but we don’t want to
“write once, suck
everywhere”*
*Loren Brichter, creator “Twitter for iPhone”/Tweetie
16
X-Platform
Requirements
•
Target multiple platforms from a single codebase
•
Apps must feel like they belong on the platform
•
Apps need to perform like native
•
Bonus: Open source and extensible
•
Bonus: Use skills we already have
Hmmm, I wonder if he has a specific technology in mind
17
Enter Titanium
Titanium is an open source framework for
building native mobile (or desktop)
applications using open web technologies
(JavaScript - optionally HTML and CSS)
18
Titanium Key Facts
•
Open Source (Apache 2.0)
•
Professional Services, SLA Support, Training, and Analytics available
from Appcelerator
Titanium Platforms
•
Desktop: Win32, OS X, Linux
•
Mobile: iOS, Android, BlackBerry, webOS (soon)
19
Titanium Projects
•
Titanium Developer (1.2.1)
•
Titanium Mobile SDK (1.3.0)
•
Titanium Desktop SDK (1.0.0)
•
Versioned separately, different release schedules
•
We will focus on Developer and the Mobile SDK
20
Titanium Features
Native UI
Location APIs
Local and Remote Data
Social APIs
Rich Media APIs
Open Source and Extensible
Integrated Analytics
Development Tools
Real native tables, tabs, sliders,
and views
Native Maps, Compass, and
Geolocation
Local SQL Database, Lightweight
Key/Value Store, XHR
Integrated Facebook Connect
and YQL
Local and streaming audio and
video, media recording
Extend Titanium with custom
modules in native code
Baked-in analytics APIs to measure
results and behavior
Develop and distribute your app for
multiple platforms from a single tool
21
Who Uses Titanium?
•
NBC Universal
•
PayPal
•
MTV
•
Anheuser-Busch
•
Computer Sciences Corporation
•
Intridea (Oil Reporter)
•
100s of Titanium apps hitting the stores each
month (should soon eclipse 1000/month)
22
Titanium Architecture
•
Desktop is HTML
focused
•
Can use other
scripting languages
•
Mobile: JavaScript
interpreted at runtime
•
JavaScript API >>
native APIs
23
What Titanium Mobile is
not:
•
Not a native wrapper around a web view
•
However, you do have a web view component for HTML/CSS UI if that is your preference
•
Your JavaScript code is invoking native APIs for UI and other native functions
•
Think MacRuby/Hot Cocoa on the desktop or some AAA mobile games which ship with a Lua interpreter
24
Example
25
Example