Blog

Book Review: Build Cross-Platform Apps using Titanium, Alloy and Appcelerator Cloud Services

In the last two weekends I had the chance to read the book Building Cross-Platform Apps using Titanium, Alloy, and Appcelerator Cloud Services written by Aaron Saunders, former Appcelerator engineer and evangelist, now CEO of Clearly Innovative, a development firm specialized in providing web and cross-platform mobile solutions with Javascript-based tools like NodeJS, Angular.JS, PhoneGap and of course Appcelerator Titanium.

The book focuses on Alloy and Appcelerator Cloud Services (ACS from now on) demonstrating how to use them to build a real app from A to Z, TiGram, a clone of Instagram. This gives the author the chance to introduce several topics, that are common in most applications, like camera/photo gallery access, maps and geolocation, social integration with Facebook and Twitter, push notifications and so on. But most importantly, he demonstrates how to build an app that needs a backend service to manage users, friends, followers, comments, reviews, push notifications without writing one line of code for that, exploiting the power and flexibility of ACS. If ACS wasn’t there, the development of the backend would have taken much more than the development of the app itself.

Other than illustrating the integration of ACS to build social-oriented apps, the book value is somewhere else: it teaches how to develop a cross-platform app with best practice on how to structure code with a MVC pattern, to promote code reusability, how to deal with error conditions and cross-platform UI design.

The author really leverages all the MVC features of Alloy: besides Views/Styles and Controllers, that are the feature most commonly used, all the business logic is handled exploiting Alloy Models, showing how to extend Models and Collections writing custom methods and above all, creating a custom sync adapter for ACS. I have always been skeptical about Alloy Models before reading this book. Probably because I don’t come from a Web development background and I met Backbone.js (on which Alloy Models/Collections are based on) only with Alloy. So Backbone.js sync adapters felt an advanced topics to me. But the books clearly show how easy is to create a custom adapter and demonstrates the benefits of using it, implementing code encapsulation and separation of concern. The Alloy MVC framework really shines once using Alloy Models/Collections, especially if you are building complex applications.

The first three chapters of the book are introductive, presenting the usual installation and configuration instructions, followed by an overview of ACS and of the Alloy framework. Starting from chapter number 4, code comes in! What I did was to set up my Mac with an external monitor from where I was reading the kindle version of the ebook, while on the Mac internal monitor, I was typing the code (not copy and paste!), following the instructions of the author to build chapter-by-chapter the TiGram app. Those chapters are the most valuable part of the book, showing in practice, with “real life” code examples, how to implement the app features and which approach to use for code structure with the Alloy MVC framework and ACS. You can clearly see how much experience Aaron has with the Titanium platform and programming in general.

If I have to find some issue, I have notices minor errors in some code examples written in the book. But this problem is easily solved taking as a reference the source code published on github: since the book come out, iOS8 and Titanium SDK 3.4.0 has been introduced and the author has updated there the code, underlining the news in the README in the repo. Another small issue is that the author in two chapters promised the introduction of the Q library (a promise library to handle async calls) and the animation library, but he didn’t do actually in the end (probably pressed by the editors to finalize the book). The integration of a promise library with the app would have added even more value to the work. I hope that the author will integrate this in the next revision of the book :)

Audience: in my opinion the book is not target to a totally newbie of Titanium. If you have some previous experience with the platform it would really teach you new techniques that will improve your skills as a Titanium developer and probably as a developer in general. I warmly recommend the book to all my students after completing our Titanium course and to anyone that wants to leverage the Alloy MVC framework and ACS at the best.



About the Author

Antonio Calanducci, EtnaTraining Founder, Mobile Solution Architect and Titanium Certified Instructor.

Add a Comment

# #