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

Launching another iOS app

So, in the first recipe, we detected whether another app is installed on the simulator/device. Now, we can do something with this information and launch another app.

How to do it...

Go back to the app.js file in Studio. Let's replace the checking code with an updated version that adds some event listeners to the labels:

if (Ti.Platform.canOpenURL("maps:")) { label1.text = label1.text + " Installed"; label1.addEventListener("click", function() { Ti.Platform.openURL("maps:"); }); } else { label1.text = label1.text + " Not installed"; } if (Ti.Platform.canOpenURL("tweetbot:")) { label2.text = label2.text + " Installed"; label2.addEventListener("click", function() { Ti.Platform.openURL("tweetbot:"); }); } else { label2.text ...

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