Preface

Not so long ago, creating a mobile application and getting it published was difficult, costly, and, for most developers, commercially unviable. Flash forward a number of years to the introduction of the iPhone and App Store, and suddenly there was a way where anyone who could write a code in Apple's Objective-C language, and had a healthy understanding of provisioning certificates for the Mac, could write a smartphone application and distribute it worldwide with minimal amount of fuss and very little red tape. During the last decade, many of us in the web development community have moved away from archaic C-based languages, and have squarely focused much of our programming knowledge on JavaScript, that ubiquitous little language that despite all its shortcomings has gained momentum and was commonplace both on and off the Web.

Shortly after that, we began to see a number of "alternative" platforms emerge which promised developers the ability to build mobile applications without the hassle of re-skilling in Objective-C, or in the case of Android, in Java. Among these was a newcomer called Titanium Mobile, which held the promise of allowing native applications to be built using only JavaScript, and the ability to make those applications cross-platform (across both iOS and Android). As of December 2011, Appcelerator's Titanium Mobile boasts over 1.5 million active developers and has released 30,000 applications in the marketplace. It has the backing of major players such as eBay and powers some of the world's most popular apps, including Wunderlist, eBay Mobile, and GetGlue. There is support for Blackberry and the mobile web. It also has the ability to build cross-platform games using popular engines such as OpenGL and Box2D. It even has its own Mobile Marketplace, where developers can sell and distribute their Titanium modules to the rest of the community.

In this book, we'll cover all of the aspects of building your mobile applications in Titanium Mobile, from layout to maps and GPS, all the way through social media integration and accessing your device's input hardware, including the camera and microphone. Each "recipe" described within is a self-contained lesson. You may pick and choose which areas you wish to read and use it as a reference. Alternatively, you can follow along each recipe in succession through most chapters and build a small app from start to finish. We'll also go through how to extend your applications using custom modules, and how to package them for distribution and sale in both the iTunes App Store and the Android Marketplace.

What this book covers

In Chapter 1, Building Apps using Native UI Components, we'll begin our journey into Titanium Mobile by understanding the basics of layout and creating controls, before moving onto tabbed interfaces, web views, and how to add and open multiple windows.

In Chapter 2, Working with Local and Remote Data Sources, we are going to build ourselves a mini-app that reads data from the Web using HTTP requests, and we'll see how to parse and iterate data in both XML and JSON formats. We'll also see how to store and retrieve data locally using an SQLite database and some basic SQL queries.

In Chapter 3, Integrating Google Maps and GPS, we'll add a MapView to your application and interact with it using annotations, geo-coding and events that track the user's location. We'll also go through the basics of adding routes and using your device's inbuilt compass to track our heading.

In Chapter 4, Enhancing your Apps with Audio, Video, and the Camera, we'll see how to interact with your device's media features using Titanium, including the camera, photo gallery, and audio recorder.

In Chapter 5, Connecting your Apps with Social Media and E-mail, we're going to see how to leverage Titanium and integrate it with Facebook, Twitter, and the e-mail capabilities of your mobiles devices. We'll also go through setting up a Facebook application and give you a brief introduction to the world of OAuth.

In Chapter 6, Getting to Grips with Events and Properties, we'll briefly run through how properties work in Titanium, and how you can get and set global variables in your app. We'll also explain how event listeners and handlers work and how to fire events, both from your controls and custom events from anywhere in your application.

In Chapter 7, Creating Animations, Transformations and Understanding Drag-and-drop, we'll show you how to create animations, and how to transform your objects using 2D and 3D matrices in Titanium. We will also run through dragging and dropping controls and capturing screenshots using the inbuilt "toImage" functionality.

In Chapter 8, Interacting with Native Phone Applications and APIs, we will discover how to interact with native device APIs, such as the device's contacts and calendar. We'll also discover how to use local notifications and background services.

In Chapter 9, Integrating your Apps with External Services, we'll dive deeper into OAuth and HTTP authentication, and also show you how to connect to external APIs, such as Yahoo! YQL and Foursquare. We will also run through the set up and integration of push notifications into your Titanium apps.

In Chapter 10, Extending your Apps with Custom Modules, we will see how you can extend the native functionality in Titanium and add your own custom, native modules using Objective-C and Xcode. We'll run through a sample module from start to finish in Xcode for creating short URLs using the Bit.ly service.

In Chapter 11, Platform Differences, Device Information, and Quirks, we'll take a look at how to use Titanium to find out information about the device, including important features such as making phone calls, checking the memory, and checking the remaining allocation of the battery. We will also go through screen orientations and how to code differences between the iOS and Android platforms.

In Chapter 12, Preparing your App for Distribution and Getting it Published, we will see how to prepare and package your applications for distribution and sale to the iTunes App Store and Android Marketplaces, along with a background into how to set up and provision your apps correctly with provisioning profiles and development certificates.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.114.85