PacktLib: Appcelerator Titanium Smartphone App Development Cookbook

Appcelerator Titanium Smartphone App Development Cookbook

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Building Apps using Native UI Components

Introduction

Building with Windows and Views

Adding a TabGroup to your app

Creating and formatting Labels

Creating TextFields for user input

Working with keyboards and keyboard toolbars

Enhancing your App with Sliders & Switches

Passing custom variables between windows

Creating buttons and capturing click events

Informing your users with dialogs and alerts

Creating charts using Raphael JS

Working with Local and Remote Data Sources

Introduction

Reading data from remote XML through HTTPClient

Displaying data using a TableView

Enhancing your TableViews with custom rows

Filtering the TableView using a SearchBar component

Speeding up your remote data access using JSON and Yahoo! YQL

Creating an SQLite database

Saving data locally using an SQLite database

Retrieving data from an SQLite database

Creating a "pull and release" refresh mechanism

Integrating Google Maps and GPS

Introduction

Adding a MapView to your application

Getting your current position using GeoLocation

Converting addresses to latitude and longitude positions

Adding annotations to your MapView

Customizing annotations and capturing MapView events

Drawing routes on your MapView

Monitoring your heading using the device compass

Enhancing your Apps with Audio, Video, and the Camera

Introduction

Choosing your capture device using an OptionDialog

Capturing photos from the camera

Choosing existing photos from the photo library

Displaying photos using ScrollableView

Saving your captured photo to the device filesystem

Capturing and playing audio via the audio recorder

Capturing video via the video recorder

Playing video files from the filesystem

Safely deleting saved files from the filesystem

Connecting your Apps with Social Media and E-mail

Introduction

Composing and sending an e-mail

Adding attachments to an e-mail

Setting up a custom Facebook application

Integrating Facebook into your Titanium App

Posting on your Facebook wall

Connecting to Twitter using OAuth

Uploading an image using PHP and HttpRequest

Sending a tweet through Birdhouse and OAuth

Getting to Grips with Events and Properties

Introduction

Reading and writing app properties

Firing and capturing events

Passing event data between your app and a Webview using custom events

Creating Animations, Transformations, and Understanding Drag-and-drop

Introduction

Animating a View using the "animate" method

Animating a View using 2D matrix and 3D matrix transforms

Dragging an ImageView using touch events

Scaling an ImageView using a Slider control

Saving our "Funny Face" image using the toImage() method

Interacting with Native Phone Applications and APIs

Introduction

Creating an Android Options menu

Accessing the contacts address book

Storing and retrieving data via the clipboard

Creating a background service on the iPhone

Displaying local notifications on the iPhone

Displaying Android notifications using intents

Storing your Android app on the device's SD card

Integrating your Apps with External Services

Introduction

Connecting to APIs that use basic authentication

Fetching data from the Google Places API

Connecting to FourSquare using OAuth

Posting a check-in to FourSquare

Searching and retrieving data via Yahoo! YQL

Integrating push notifications with UrbanAirship.com

Testing push notifications using PHP and HTTP POST

Extending your Apps With Custom Modules

Introduction

Integrating an existing module—the PayPal Mobile Payment Library

Preparing your iOS module development environment

Developing a new iPhone module using XCode

Creating a public API method

Packaging and testing your module using the test harness

Packaging your module for distribution and sale

Platform Differences, Device Information, and Quirks

Introduction

Gathering information about your device

Obtaining the device's screen dimensions

Understanding device orientation modes

Coding around differences between the iOS and Android APIs

Ensuring your device can make phone calls

Preparing your App for Distribution and Getting it Published

Introduction

Joining the iOS Developer Program

Installing iOS Developer Certificates and Provisioning Profiles

Build your app for iOS using Titanium Studio

Joining the Google Android Developer Program

Creating your application's distribution key

Building and submitting your app to the Android Marketplace