Augmented Reality using Appcelerator Titanium Starter

Augmented Reality using Appcelerator Titanium Starter

Or, “How to write apps that turn your smartphone into a Terminator-style heads up display”

If you aren’t familiar with Augmented Reality, it’s the fancy phrase for adding meta-information to the real-life objects around you. Have you ever been to the top of a very high point and read the signage that names those objects in the distance and how far away they were?  Used the signs on a golf course that tell you how far away the pin is? That’s a form of augmented reality.

This book lays out a solution to write smartphone apps that augment the reality around you.   The solution provided has been coded using the Appcelerator Titanium Framework which means the app will work on Android and iPhones  as well as mobile browsers. The author says it can be applied to most other frameworks and native solutions, but so much of the implementation details is taken care of by the Titanium Framework that you’d have to do a lot of work unless whatever alternative framework you choose has the same functionality as Titanium.

Before reading this book I would have guessed that writing any such app would be incredibly difficult, but Mr. Ward does a nice job of breaking down what APIs are available and how to use them. The device’s camera is used as a view of reality and its compass, level and accelerometer to determine where you are and where you’re looking. The book’s example uses the Google Places API to pull in the interesting data it wants to show on the screen, though this is probably the part you’ll need to provide for your custom application.

The hardest part of implementing the solution was getting my copy of Appcelerator up-to-date, pulling the source down from Git, and setting up the Google API. I actually bailed on getting the source from Git and pulled it down from the book’s page on Packt Publishing’s website.

This is mentioned right away in the ForeWord and is true: This book assumes you know some JavaScript already. It is not a JavaScript tutorial though you will pick up some Javascript best practices by studying the code. It’s very well written (no application-level global variables are used and each part of the application is split into its own module or set of modules)  and well documented, so any experienced developer should be able to run with these ideas.

I really enjoyed the mathematical discussion of how to calculate the positioning of the blips on the screen, given your current GPS setting and bearing. I think a complete book could be written on the various alternative methods for accomplishing this and discussing the trade offs of accuracy vs. speed and processor utilization. Titanium makes all of this almost too simple with its built in functions for acquiring position and calculating distances.

This book is a fat-free 52 pages and reads more like a research whitepaper on some best practices for implementing a solution as a launching point for your own apps than an exhaustive treatise on the subject.  Having written a similar paper recently I understand that you cannot walk through every conceivable possible usage of this technology, and I appreciate the author’s willingness to trust the reader’s intelligence and creativity rather than spell out every possibility in detail.

Developers looking for a quick leg-up on writing Augmented Reality apps would be well served to pick up this book. The author has thought deeply about the problems and solutions involved and will save you a ton of frustration.


Posted

in

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.