Note
Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the worlds leading authors in technology and business.
Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.
Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like OReilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
OReilly Media, Inc. |
1005 Gravenstein Highway North |
Sebastopol, CA 95472 |
800-998-9938 (in the United States or Canada) |
707-829-0515 (international or local) |
707-829-0104 (fax) |
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/app-titanium.
To comment or ask technical questions about this book, send email to .
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Acknowledgments
Thanks to everyone who helped out with the book. Its far better than I would have been able to do on my own.
Thanks to John Plebanski, Maximiliano Firtman, Sanjeev Dhavala, and Michal F. Collins III for their insights into the book during its growth. Thanks to Andy at OReilly for caring about this book as much as I did and helping me to make the best book possible.
Thanks to Appcelerator for making Titanium to bring back the fun into programming again. When you can focus on the functionality of a mobile app, without having to worry as much about the nitty-gritty details, its always more fun and more of a joy to do.
Most importantly, thanks to my loving wife Lisa and the rest of the family for giving me the time away from them to work on this. Without them to share the end result, the pursuit of the book would mean nothing.
Chapter 1. The Benefits of Titanium
If youre reading this book, you probably want to know more about Titanium, so lets do a quick overview to make sure were all starting on the same page.
Titanium is a product by a company called Appcelerator that allows you to build mobile apps in JavaScript and compile it out to native apps for iOS, Android, and BlackBerry. Although BlackBerry support does exist, its not nearly as mature or robust as iOS and Android. However, if you absolutely must have BlackBerry versions of your app, its good to know that its there.
Although Titanium does use JavaScript, its very, very important to note that youre not building your apps using HTML5 or CSS3, just JavaScript. With a web page, you modify CSS properties to modify the look and feel of the objects. But if you want to change the appearance of a button in Titanium, you modify parameters on the button to change its look and feel. The concepts are similar, but good to know that CSS isnt used at all with Titanium. When you compile your Titanium app to iOS or Android, the Titanium engine processes your JavaScript and then builds an appropriate native project for the platform that youre building for.
For iOS, this means that an actual Xcode project is created and then compiled using Apples compiler, so that you end up with a native .IPA that you can deploy to a device, or Apples App Store. Its a similar process with Android. A native Java mobile application is created and compiled using the Android compiler. The end application that is created is 100% native, using 100% native controls.