Book Image

Appcelerator Titanium Smartphone App Development Cookbook

By : Boydlee Pollentine
Book Image

Appcelerator Titanium Smartphone App Development Cookbook

By: Boydlee Pollentine

Overview of this book

<p>Appcelerator Titanium Mobile allows developers to realize their potential to develop full native iPhone and Android applications by using free Titanium Studio tools without the need to know Objective-C or Java. This practical hands-on cookbook shows you exactly how to leverage the Titanium API to its full advantage and become confident in developing mobile applications in no time at all.<br /><br />Appcelerator Titanium Smartphone App Development Cookbook offers a set of practical and clear recipes with a step-by-step approach for building native applications for both the iPhone and Android platforms using your existing knowledge of JavaScript.<br /><br />This cookbook takes a pragmatic approach to using your JavaScript knowledge to create applications for the iPhone and Android platforms, from putting together basic UIs to handling events and implementation of third party services such Twitter, Facebook and Push notifications. This book shows you how to utilize both remote and local datasources using XML, JSON and the SQLite database system. The topics covered will guide you to use popular Titanium Studio tools effectively and help you leverage all the advanced mobile features such as Geolocation, Accelerometer, animation and more. Finally, you’ll learn how to register developer accounts and how to publish your very own apps to the Android and Apple marketplaces.</p>
Table of Contents (18 chapters)
Appcelerator Titanium Smartphone App Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Fetching data from the Google Places API


The Google Places API is a new part of Google Maps and returns information about places (for example, banks, cash machines, services, airports, and more). It marks an attempt by Google to connect users directly to shops or items of interest near their location, and is heavily geared towards mobile usage. In this recipe, we will create a new module which will contain all of the code required to connect to, and return data from, the Google Places API.

Getting ready

You will require an API key from Google in order to perform requests against the Places API. You can obtain a key from Google's developer website here: https://code.google.com/apis/console.

Note

Complete source code for this recipe can be found in the /Chapter 9/Recipe 2 folder.

How to do it…

Create a new project in Titanium Studio, which you can give any name you want. Then, create a new file called placesapi.js file, and save it to your project's Resources directory. Type the following code into...