13 Years in Business
Software Consultants
International Speakers
Training
App Developer (JavaScript, Objective-C, Java)
To our success!
% titanium create \
--name=appname \
--id=com.mysticcoders.helloworld \
--platforms=android,ipad,iphone
Titanium Command-Line Interface, CLI version 3.0.22, Titanium SDK version 3.0.0.GA
Copyright (c) 2012, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[INFO] Creating Titanium Mobile application project
[INFO] Project 'helloworld' created successfully in 84ms
% cd helloworld
% alloy new
<Alloy>
<Window class="container">
<Label id="label" onClick="doClick">Hello, World</Label>
</Window>
</Alloy>
".container": {
backgroundColor:"white"
},
"Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000"
}
function doClick(e) {
alert($.label.text);
}
$.index.open();
Titanium is an open source framework for building mobile applications using Javascript.
Data-driven web service clients
Web service mash-ups
Social utilities
Casual games
Store | Cost |
---|---|
iOS Developer | $99 USD/YR |
Apple Profit | 30% of All Sales |
Manage and run Titanium applications
Package applications for distribution
Run on a device for testing
Develop in derivative Eclipse editor Aptana
Find the TitaniumStudio.ini file
var int=self.setInterval(function(){printMem()},1000);
function printMem() {
Ti.API.debug(Ti.Platform.availableMemory);
}
if(Ti.Platform.osname === ”ipad”) {
Ti.include(‘app_ipad.js’);
} else {
Ti.include(‘app_iphone.js’);
}
function isiOS7() {
// iOS-specific test
if (Titanium.Platform.name == 'iPhone OS') {
var version = Titanium.Platform.version.split(".");
var major = parseInt(version[0],10);
// Can only test this support on a 3.2+ device
if (major >= 7) {
return true;
}
}
return false;
}
Installing NodeJS
On Windows: http://nodejs.org/dist/latest/node.exe
On Mac OS X: http://nodejs.org/dist/latest/
On Linux: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
Installing Titanium Runtime + Alloy
% npm install -g titanium
% npm install -g alloy
Built on Backbone.js v0.9.2
Underscore.js included
Model / View / Controller
Clear separation of concerns
Conditional view / styles in View XML / TSS files
<Window class="container" id="index" platform="ios" \
formFactor="tablet">
<Window id="index" platform="ios" formFactor="handheld" \
barColor="#000">
Titanium | PhoneGap / Cordova | |
---|---|---|
Platform | iOS, Android, Windows, Blackberry, HTML5 | iOS, Android, WebOS, Windows, RIM, Symbian |
Device HW | GPS, Vibration, Accelerometer, Compass, Camera, Microphone | GPS, Vibration, Accelerometer, Compass, Camera, Microphone |
Native UI | Yes | No |
Performance | Not as fast as native, but "good enough" | As fast as HTML / JavaScript on device |
kinabalu @ irc://irc.freenode.net
#titanium_app, #javascript