Unleash Your Potential - Namagunga Girls Coding Club
Modeveast Appcelerator Presentation
1. Building Mobile Apps with
Titanium Appcelerator
Part Two
Aaron K. Saunders
Appcelerator Platform Evangelist
Founder/CTO Clearly Innovative Inc.
2. Who Am I?
• Founder/CTO Clearly Innovative Inc.
• Appcelerator Platform Evangelist
• 25+ years experience in software
development field
– Recently Enterprise Web Development w/Java &
Open Source Technologies
• Mobile App Development with Appcelerator
for last two years
• Top Contributor on Appcelerator Q&A Forum
11. Use The Tools
• Titanium Studio is your friend
– Eclipse Based IDE
– Integrated debugger
– Code completion
– Project Management
– SVN/Git/Terminal Integration
– Xcode Build and Deployment Integration
• Command Line still available
13. Use The Documentation
• QA Forum
– Lots of content
– Improved overall site search capabilities
– Monitored by Developer Relations
• Appcelerator Wiki
– Recent restructuring, lots of good stuff and
sample code
• FREE, FREE, FREE Online Videos for
Appcelerator Certification Exam w/Code
14.
15. Use The Modules
• Appcelerator Marketplace
• Search Github
• Ask in the forums
• Build Your Own
16.
17. A Change is Upon Us
• Not Recommended
– Write your app like Kitchen Sink
– multiple context application structure
– use of Ti.Include
• Recommended
– CommonJS modules for application structure
– Single Application namespace
– Pass variables into modules
– Event Based Programming
18. CommonJS Application
Structure
// app.js
// commonjs module for database functionality
var db = require('db');
// commonjs module for user interface functionality
var ui = require('ui');
// call methods on objects
db.createDb();
var tabGroup = ui.createAppTabGroup();
tabGroup.open();
19. CommonJS Module Structure
// db.js
// variable scope is local to this module
var DATABASE_NAME = 'todo';
// exports indicates that the method is public
exports.createDb = function() {
Ti.Database.install('todo.sqlite', DATABASE_NAME);
};
exports.selectItems = function(_done) {
var retData = [];
var db = Ti.Database.open(DATABASE_NAME);
var rows = db.execute('select ROWID, * from todo where done = ?', _done);
while (rows.isValidRow()) {
retData.push({item:rows.fieldByName('item'), id:rows.fieldByName('ROWID')});
rows.next();
}
db.close();
return retData;
};
20. Examples?
• Sample Projects will soon be added to
Titanium Studio
• See Wiki Page
– http://wiki.appcelerator.org/display/guides
/CommonJS+in+Titanium
• Android & iOS Compatible
– RSS Feed Application
– Map/Location Based Application
– TODO database Application