INTRODUCTION

THERE'S A GREAT DEMAND TODAY for mobile content and applications. Many of the leading device manufacturers and platforms are supporting Adobe Flash Player, and since many of them are also integrating Adobe AIR directly into the mobile device's OS, there has never been a better time for getting to know how to author content designed for the small screen.

With the fast-moving pace of the mobile industry it's really important to keep abreast of the latest developments in the Adobe Flash Platform, and so Beginning Flash, Flex, and AIR Development for Mobile Devices includes all the key developments of “Flash on mobile” since my first book, Professional Flash Lite Mobile Development (Wrox, 2010).

Over the course of the book, you learn how to utilize industry-leading software for authoring mobile content. You'll become familiar with the Adobe Flex framework and the MXML components optimized for mobile devices. You'll also learn how to utilize the Flash Player 10.3 and AIR ActionScript 3.0 APIs.

The material set out in this book is really targeted for developers at all levels. At a base level it will help you start creating Flash-enabled mobile applications. This book also contains extensive code examples that are explained in detail and essentially cover how you create mobile applications from the ground up, targeted at Flash Player 10.1 and AIR 2.5, using ActionScript 3.0. The book is for anyone wanting to showcase mobile content across a range of mobile platforms.

WHOM THIS BOOK IS FOR

This book is aimed at mobile developers looking to create and distribute new mobile applications.

Programmers and developers of all experiences will be able to use the book as a reference on how to author content for mobiles and devices using Adobe Flash, Flex, and AIR.

The book is designed to help both experienced mobile developers and newcomers gain a comprehensive introduction to Flash, Flex, and AIR. As such, Chapters 1 and 2 are primarily aimed at newcomers to the Adobe Flash Platform; the background to Flash, Flex, and AIR is discussed, along with the tools used in the creation of mobile applications — namely, Flash Builder and Device Central CS5.5.

WHAT THIS BOOK COVERS

Beginning Flash, Flex, and AIR Development for Mobile Devices introduces the reader to a number of topics covering the key authoring aspects of developing for the current iteration of the Adobe Flash Platform, guiding the reader through the following chapters:

  • Chapter 1An Introduction to Flash, Flex, and AIR: This chapter provides an overview of the Adobe Flash Platform covering the Flash Player, the Flex framework, and the Adobe Integrated Runtime. It also takes the reader through the basics of programming with AS3 and a light introduction to MXML.
  • Chapter 2Getting Started: This chapter focuses on getting started with the tools to carry out mobile development, taking a look at three essential tools used in developing and testing Flash content: Adobe Flash Builder, Adobe Flash Professional CS5, and Adobe Device Central CS5.
  • Chapter 3Building AIR Applications for Android, BlackBerry, and iOS: This chapter takes you through building AIR 2.5 applications for the Google Android mobile platform, with a heavy portion of the chapter focusing on the Adobe AIR Application Descriptor settings. Here you also learn how you update AIR applications for the Google Android platform.
  • Chapter 4Touch, Multitouch, and Gestures: This chapter covers the user input features introduced in Flash Player 10.1 and provides extensive code listings for you to follow, using Adobe Flash Builder 4.5 and Adobe Device Central CS5 to create and test the examples.
  • Chapter 5Developing for Multiple Screen Sizes: This chapter guides you through the best practices for creating content for multiple devices with different screen sizes.
  • Chapter 6Debugging Applications: This chapter shows you how to utilize the Flash Debug Perspective in Adobe Flash Builder. It also covers Error Handling and in particular Global Error Handling, a feature introduced in Flash Player 10.1.
  • Chapter 7Working with the Filesystem: This chapter details how to use the AIR File System API, and walks you through creating a Files Explorer mobile application using MXML and the Flex framework in Adobe Flash Builder.
  • Chapter 8Working with Data: This chapter introduces some of the ways you can utilize data within mobile applications. It also focuses on SQLite and guides you through the creation of a Teams database application.
  • Chapter 9Working with Audio and Video: This chapter highlights multiple ways in which you can include sound and video in your mobile applications, and introduces you to the Open Source Media Framework (OSMF) framework.
  • Chapter 10Utilizing Device Features: This chapter draws your attention to the APIs introduced in AIR 2.7 that particularly rely on device support, including utilizing the device's camera, microphone, web browser, and geolocation features.

HOW THIS BOOK IS STRUCTURED

The book is written in such a way that it allows the reader to pick up and start from any chapter.

By design, Chapters 1 through 3 contain relatively little code when compared to later chapters; from Chapter 4 onwards, you'll notice a substantial increase in the number of examples to follow and tasks to carry out.

Each chapter in the book will start with a list of chapter objectives and an introduction, and then end with a chapter summary, exercises, and a table of the key concepts learned in the chapter.

Chapter 10 will feature more tasks that rely on the reader using a mobile device to test content.

WHAT YOU NEED TO USE THIS BOOK

You will need to have one of the following Operating Systems:

  • Mac OS
  • Windows
  • Linux

To use the code samples and run the example applications in this book you will need the following:

  • Adobe Flash Builder 4.5
  • Adobe Device Central CS5.5
  • Adobe AIR 2.7 SDK

While you do not explicitly need a Flash- or AIR-enabled mobile device, to complete all the tasks, a Google Android device running Gingerbread 2.3.4 is recommended. Many of the examples covered in this book, in addition to Google Android, will run on Apple iOS devices with version 4.x and above, including the iPad, iPhone, and iPod Touch devices. Each of the examples will also work on the BlackBerry PlayBook device, running the BlackBerry Tablet OS.

CONVENTIONS

To help you get the most from the text and keep track of what's happening, we've used a number of conventions throughout the book. Among these are the Try It Out activity and the accompanying How It Works. A sample of the format follows:

image The Try It Out is an exercise you should work through, following the text in the book.

  1. The exercise usually consists of a set of steps.
  2. Each step has a number.
  3. Follow the steps through with your copy of the database.

image WARNING Boxes with a warning icon like this one hold important, not-to-beforgotten information that is directly relevant to the surrounding text.

image NOTE The pencil icon indicates notes, tips, hints, tricks, and asides to the current discussion.

As for styles in the text:

  • We highlight new terms and important words when we introduce them.
  • We show fi lenames, URLs, and code within the text like so: object.method().

We present code in a few different ways:

We use this monofont type with no highlighting for some of the code examples.

We use bold to emphasize code that is particularly important in the present context.

Also, the Source view in Flash Builder provides a rich color scheme to indicate various parts of code syntax. This is a great tool to help you learn language features in the editor and to help prevent mistakes as you code. To reinforce the colors used in Flash Builder, the code listings in this book are colorized using colors similar to what you would see on screen in Flash Builder working with the book's code. In order to optimize print clarity, some colors have a slightly different hue in print than what you see on screen. But all the colors for the code in this book should be close enough to the default Flash Builder colors to give you an accurate representation of the colors.

The following example taken from Chapter 4 shows how code could be colored and highlighted:

package
{
      import flash.display.Sprite;
      import flash.text.TextField;
      import flash.text.TextFieldAutoSize;
      import flash.ui.Multitouch;

      public class MultitouchAndGestures extends Sprite
      {
           private var multitouch:TextField;

           public function MultitouchAndGestures()

SOURCE CODE

As you work through the examples in this book, you may choose either to type in all the code manually, or to use the source code files that accompany the book. All the source code used in this book is available for download at www.wrox.com. When at the site, simply locate the book's title (use the Search box or one of the title lists) and click the Download Code link on the book's detail page to obtain all the source code for the book. Code that is included on the website is highlighted by the following icon:

image

Listings include the filename in the title and also are identified by a Listing number. If the downloaded item is just a code snippet, you'll find the filename in a code note such as this in the text:

image

image NOTE Because many books have similar titles, you may find it easiest to search by ISBN; this book's ISBN is 978-0-470-94815-6.

Once you download the code, just decompress it with your favorite compression tool. Alternately, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

ERRATA

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, like a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata, you may save another reader hours of frustration, and at the same time, you will be helping us provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list, including links to each book's errata, is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don't spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

P2P.WROX.COM

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At p2p.wrox.com, you will find a number of different forums that will help you, not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

  1. Go to p2p.wrox.com and click the Register link.
  2. Read the terms of use and click Agree.
  3. Complete the required information to join, as well as any optional information you wish to provide, and click Submit.
  4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

image NOTE You can read messages in the forums without joining P2P, but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works, as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

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

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