O'Reilly logo

Appcelerator Titanium Smartphone App Development Cookbook - Second Edition by Jason Kneen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coding around the differences between the iOS and Android APIs

Although Appcelerator Titanium makes much of the hard work of integrating numerous operating systems and devices invisible to you, the developer, there are going to be times when you simply have to write some code that is platform-specific. The most common way of doing this is by checking the osname property from the Ti.Platform namespace.

In this recipe, we will create a simple screen that shows a custom activity indicator when the device is an iPhone, and a standard indicator when the user is using an Android device.

Again, the complete source code for this recipe can be found in the /Chapter 11/Recipe 4 folder.

How to do it…

Open your app.js file, remove any existing code, and type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required