You are previewing Appcelerator Titanium Smartphone App Development Cookbook.
O'Reilly logo
Appcelerator Titanium Smartphone App Development Cookbook

Book Description

You don’t need to know Objective C or Java to create native apps for iPhone and Android. All you need is some JavaScript or web development know-how and these superb 80+ recipes for Appcelerator Titanium.

  • Leverage your JavaScript skills to write mobile applications using Titanium Studio tools with the native advantage!

  • Extend the Titanium platform with your own native modules

  • A practical guide for packaging and submitting your apps to both the iTunes store and Android Marketplace

  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible

  • In Detail

    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.

    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.

    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.

    Table of Contents

    1. Appcelerator Titanium Smartphone App Development Cookbook
      1. Table of Contents
      2. Appcelerator Titanium Smartphone App Development Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Building Apps using Native UI Components
        1. Introduction
        2. Building with Windows and Views
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Adding a TabGroup to your app
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Creating and formatting Labels
          1. How to do it...
          2. How it works...
        5. Creating TextFields for user input
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Retrieving text…
            2. Experimenting with other TextField border styles…
        6. Working with keyboards and keyboard toolbars
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Experimenting with keyboard styles
        7. Enhancing your App with Sliders & Switches
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
        8. Passing custom variables between windows
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        9. Creating buttons and capturing click events
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Informing your users with dialogs and alerts
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. There's more...
        11. Creating charts using Raphael JS
          1. Getting ready
          2. How to do it...
          3. How it works...
      9. 2. Working with Local and Remote Data Sources
        1. Introduction
          1. Pre-requisites
        2. Reading data from remote XML through HTTPClient
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Displaying data using a TableView
          1. How to do it...
          2. How it works...
        4. Enhancing your TableViews with custom rows
          1. How to do it...
          2. How it works...
        5. Filtering the TableView using a SearchBar component
          1. How to do it...
          2. How it works...
        6. Speeding up your remote data access using JSON and Yahoo! YQL
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Combining multiple RSS feeds…
        7. Creating an SQLite database
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Attaching a pre-populated database file…
        8. Saving data locally using an SQLite database
          1. How to do it...
          2. How it works...
          3. There's more...
        9. Retrieving data from an SQLite database
          1. How to do it...
          2. How it works...
        10. Creating a "pull and release" refresh mechanism
          1. How to do it...
          2. How it works...
      10. 3. Integrating Google Maps and GPS
        1. Introduction
          1. Pre-requisites
        2. Adding a MapView to your application
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
            1. Changing your MapView's style
        3. Getting your current position using GeoLocation
          1. How to do it...
          2. How it works…
        4. Converting addresses to latitude and longitude positions
          1. How to do it...
          2. How it works…
        5. Adding annotations to your MapView
          1. How to do it...
          2. How it works...
        6. Customizing annotations and capturing MapView events
          1. How to do it...
          2. How it works...
        7. Drawing routes on your MapView
          1. How to do it...
          2. How it works...
        8. Monitoring your heading using the device compass
          1. How to do it...
          2. How it works...
      11. 4. Enhancing your Apps with Audio, Video, and the Camera
        1. Introduction
          1. Pre-requisites
        2. Choosing your capture device using an OptionDialog
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Capturing photos from the camera
          1. How to do it...
          2. How it works…
        4. Choosing existing photos from the photo library
          1. How to do it...
          2. How it works…
          3. There's more...
            1. Understanding Media Types
            2. Saving to photos
        5. Displaying photos using ScrollableView
          1. How to do it...
          2. How it works…
        6. Saving your captured photo to the device filesystem
          1. How to do it...
          2. How it works…
        7. Capturing and playing audio via the audio recorder
          1. Getting ready
          2. How to do it...
          3. How it works…
        8. Capturing video via the video recorder
          1. Getting ready
          2. How to do it...
          3. How it works…
        9. Playing video files from the filesystem
          1. How to do it...
          2. How it works…
          3. There's more…
        10. Safely deleting saved files from the filesystem
          1. How to do it...
          2. How it works…
          3. There's more...
      12. 5. Connecting your Apps with Social Media and E-mail
        1. Introduction
          1. Pre-requisites
        2. Composing and sending an e-mail
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. One more thing
        3. Adding attachments to an e-mail
          1. How to do it...
          2. How it works...
        4. Setting up a custom Facebook application
          1. How to do it...
        5. Integrating Facebook into your Titanium App
          1. How to do it...
          2. How it works...
        6. Posting on your Facebook wall
          1. How to do it...
          2. How it works…
        7. Connecting to Twitter using OAuth
          1. How to do it...
        8. Uploading an image using PHP and HttpRequest
          1. How to do it...
          2. How it works…
        9. Sending a tweet through Birdhouse and OAuth
          1. How to do it…
          2. How it works…
      13. 6. Getting to Grips with Events and Properties
        1. Introduction
          1. When should you use app properties?
          2. What object types can be stored as app properties?
        2. Reading and writing app properties
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Firing and capturing events
          1. How to do it…
          2. How it works…
        4. Passing event data between your app and a Webview using custom events
          1. See also
          2. How to do it…
          3. How it works…
          4. There's more…
      14. 7. Creating Animations, Transformations, and Understanding Drag-and-drop
        1. Introduction
        2. Animating a View using the "animate" method
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Animating a View using 2D matrix and 3D matrix transforms
          1. How to do it…
          2. How it works…
        4. Dragging an ImageView using touch events
          1. How to do it…
          2. How it works…
        5. Scaling an ImageView using a Slider control
          1. How to do it…
          2. How it works…
        6. Saving our "Funny Face" image using the toImage() method
          1. How to do it…
          2. How it works…
      15. 8. Interacting with Native Phone Applications and APIs
        1. Introduction
        2. Creating an Android Options menu
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. Menu icon sizes for Android devices
        3. Accessing the contacts address book
          1. How to do it…
          2. How it works…
        4. Storing and retrieving data via the clipboard
          1. How to do it…
          2. How it works…
        5. Creating a background service on the iPhone
          1. How to do it…
          2. How it works…
        6. Displaying local notifications on the iPhone
          1. How to do it…
          2. How it works…
        7. Displaying Android notifications using intents
          1. How to do it…
          2. How it works…
        8. Storing your Android app on the device's SD card
          1. How to do it…
          2. How it works…
      16. 9. Integrating your Apps with External Services
        1. Introduction
        2. Connecting to APIs that use basic authentication
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Fetching data from the Google Places API
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Connecting to FourSquare using OAuth
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Posting a check-in to FourSquare
          1. How to do it…
          2. How it works…
        6. Searching and retrieving data via Yahoo! YQL
          1. How to do it…
          2. How it works…
        7. Integrating push notifications with UrbanAirship.com
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Testing push notifications using PHP and HTTP POST
          1. How to do it…
          2. How it works…
      17. 10. Extending your Apps With Custom Modules
        1. Introduction
        2. Integrating an existing module—the PayPal Mobile Payment Library
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Preparing your iOS module development environment
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Developing a new iPhone module using XCode
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Creating a public API method
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Packaging and testing your module using the test harness
          1. How to do it…
          2. How it works…
        7. Packaging your module for distribution and sale
          1. How to do it…
          2. How it works…
      18. 11. Platform Differences, Device Information, and Quirks
        1. Introduction
        2. Gathering information about your device
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Obtaining the device's screen dimensions
          1. How to do it…
          2. How it works…
        4. Understanding device orientation modes
          1. How to do it…
          2. How it works…
        5. Coding around differences between the iOS and Android APIs
          1. How to do it…
          2. How it works…
        6. Ensuring your device can make phone calls
          1. How to do it…
          2. How it works…
      19. 12. Preparing your App for Distribution and Getting it Published
        1. Introduction
        2. Joining the iOS Developer Program
          1. How to do it…
        3. Installing iOS Developer Certificates and Provisioning Profiles
          1. How to do it...
        4. Build your app for iOS using Titanium Studio
          1. How to do it...
        5. Joining the Google Android Developer Program
          1. How to do it…
        6. Creating your application's distribution key
          1. How to do it…
        7. Building and submitting your app to the Android Marketplace
          1. How to do it…
      20. Index