ebook img

Developing BlackBerry Tablet Applications with Flex 4.5 PDF

114 Pages·2011·13.149 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Developing BlackBerry Tablet Applications with Flex 4.5

www.it-ebooks.info www.it-ebooks.info Developing BlackBerry Tablet Applications with Flex 4.5 www.it-ebooks.info www.it-ebooks.info Developing BlackBerry Tablet Applications with Flex 4.5 Rich Tretola Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo www.it-ebooks.info Developing BlackBerry Tablet Applications with Flex 4.5 by Rich Tretola Copyright © 2011 Rich Tretola. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Mary Treseler Cover Designer: Karen Montgomery Production Editor: Holly Bauer Interior Designer: David Futato Proofreader: Holly Bauer Illustrator: Robert Romano Printing History: July 2011: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. The image of a parrot and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-30556-7 [LSI] 1308602843 www.it-ebooks.info Table of Contents Preface ..................................................................... vii 1. Hello World ............................................................ 1 Create a Flex Mobile Project 1 Set Up a Test Environment 7 Debug a Flex Mobile Project 23 2. Application Layouts .................................................... 29 Blank Application 29 View-Based Application 31 View Life Cycle 38 Tabbed Application 38 3. Permissions and Configuration Settings ................................... 41 Permissions 41 Other Configuration Settings 44 Automatically reorient 44 Full Screen 45 Automatically scale application for different screen densities 46 Aspect Ratio 46 4. Exploring the APIs ..................................................... 47 Accelerometer 47 GPS 48 Camera UI 50 Camera Roll 53 Microphone 55 Multi-Touch 58 GestureEvent 58 TransformGesture 61 Busy Indicator 65 v www.it-ebooks.info 5. Working with the File System ............................................ 67 File System Access 67 Folder Aliases 67 Read and Write to the File System 69 File Browse for Single File 71 File Browse for Multiple Files 73 SQLite Databases 75 6. OS Interactions ........................................................ 81 Open in Browser 81 Splash Screen 82 StageWebView 83 Screen Options 85 Layout 85 ActionBar 86 Native QNX Components 88 7. Publish to BlackBerry Installer ........................................... 95 vi | Table of Contents www.it-ebooks.info Preface Introduction to BlackBerry Tablet OS In 2011, Research in Motion (RIM) introduced an entirely new operating system known as the BlackBerry Tablet OS. The first device using this new operating system was released in May of 2011 and was known as the BlackBerry PlayBook. Through Adobe’s partnership with RIM, this new operating system was built fully integrated with the Adobe AIR runtime; as a result, the performance of Adobe AIR applications running on BlackBerry tablet devices is outstanding, and RIM has built specific libraries acces- sible to ActionScript for deep integration within the operating system. This book walks you through the creation of your first Adobe AIR application using the Flex 4.5 framework and provides examples of how to interact with the device’s components. These include the GPS unit, camera, gallery, accelerometer, multi-touch display, and the StageWebView, Operating System interactions, native components, and more. Who This Book Is For Developing BlackBerry Tablet OS Applications with Adobe Flex 4.5 targets developers of every skill level. It starts with a basic Hello World application and then quickly moves to more complicated examples where the BlackBerry Tablet OS APIs are explored. Who This Book Is Not For This book is not for developers who are interested in developing native BlackBerry applications. This book only provides examples of BlackBerry Tablet OS application development using Adobe Flex 4.5 and ActionScript 3. Conventions Used in This Book The following typographical conventions are used in this book: vii www.it-ebooks.info Menu options Menu options are shown using the → character, such as File→Open. Italic Italic indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width This is used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold This indicates commands or other text that should be typed literally by you. Constant width italic This indicates text that should be replaced with user-supplied values or values determined by context. This Book’s Example Files You can download the example files for this book from this location: http://examples.oreilly.com/9781449305567-files/ Where necessary, multiple code samples are provided for each recipe to correspond with the different development environments. Each sample will be separated into a folder for the specific environment. Each application should include the needed code for your environment as well as an application descriptor file. Using the Code Examples This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. In addition, answering a question by citing this book and quoting example code does not require permission. However, selling or distributing a CD-ROM of ex- amples from O’Reilly books does require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission. We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Developing BlackBerry Tablet Applications with Flex 4.5 by rich Tretola (O’Reilly). Copyright 2011 Rich Tretola, 978-1-449-30556-7.” If you think your use of code examples falls outside fair use or the permission given here, feel free to contact us at [email protected]. viii | Preface www.it-ebooks.info

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.