Book Review: Flash Development for Android Cookbook

September 22nd, 2011 by Adrian

Flash Development for Android Cookbook front cover

Title: Flash Development for Android Cookbook
Author: Joseph Labrecque
Publisher: Packt Publishing
Released: June 2011
Website link: http://goo.gl/icJsk
Amazon link: http://goo.gl/TGBv5

For any Flash or Flex developer looking to create applications for mobile (in particular Android ones) then this is a great book to have on your desk! Weighing in at 372 pages, there is a lot of content in there just waiting for you to try out and play with.

First things first, this is a Cookbook. It’s not a reference title listing every single API and documenting every single class available. Though to be honest, it seems to cover most of the new AIR for Android features. The idea behind a Cookbook is to provide you with a selection of ‘recipes’ or common tasks, and then explain how to go about solving them in a clear and concise way. This book does this brilliantly. It is the sort of book you can dib into when you have a specific thing to get done in your app and you’re not sure where to start. Having said that, I basically read it from cover to cover, and still found it very informative and enjoyable.

The book is broken up into the following 11 chapters …

  • Chapter 1: Getting Ready to Work with Android: Development Environment and Project Setup (10 recipes)
  • Chapter 2: Interaction Experience: Multitouch, Gestures, and Other Input (13 recipes)
  • Chapter 3: Movement through Space: Accelerometer and Geolocation Sensors (9 recipes)
  • Chapter 4: Visual and Audio Input: Camera and Microphone Access (6 recipes)
  • Chapter 5: Rich Media Presentation: Working with Images, Video, and Audio (7 recipes)
  • Chapter 6: Structural Adaptation: Handling Device Layout and Scaling (12 recipes)
  • Chapter 7: Native Interaction: StageWebView and URI Handlers (10 recipes)
  • Chapter 8: Abundant Access: File System and Local Database (7 recipes)
  • Chapter 9: Manifest Assurance: Security and Android Permissions (6 recipes)
  • Chapter 10: Avoiding Problems: Debugging and Resource Considerations (6 recipes)
  • Chapter 11: Final Considerations: Application Compilation and Distribution (10 recipes)

All these chapter are equally important and cover a wide range of features, but which ones you’ll actually need to use will depend on your project and what you are trying to achieve. Although the title of this book specifies Android, most of the code in this book will work equally well on iOS devices and the BlackBerry PlayBook. That’s the joy of developing using ActionScript and AIR! :-)

I was particularly pleased to see that nearly all the code examples were IDE agnostic and didn’t tie you in to the Flex framework. They concentrated on using pure ActionScript in whatever IDE you feel comfortable working in. In fact, Joseph even went to the trouble of explaining any IDE specific stuff using example in Flash Pro CS5.5, Flash Builder 4.5 and FDT 4.1.

Once you have had a flick through at some of the examples it quickly becomes clear that Adobe have done a really good job at providing a consistent and logical API for achieving all these new mobile specific things. And this book does a great job of demystifying it all.

My one criticism would be that there is quite a lot of repetitive code (about 14 lines) in each example, where Joseph sets up an output textfield (and accompanying textformat) for demonstration purposes. But I guess I noticed it more because I was reading the book straight through (not how it was intended to be read). At least this way, each ‘recipe’ or example is self contained and provides everything you need to get you up and running easily.

I did notice a few errors here and there (code and layout), but nothing too serious that would cause you issues.

I’d thoroughly recommend this title to anyone who is interested in creating mobile apps for either Android, iOS or PlayBook using AIR and ActionScript.

Sample Chaper
Chapter 4 - Visual and Audio Input: Camera and Microphone Access can be downloaded as a free PDF file here.

Related books by other authors and publishers include:

Posted in AIR, Android, Books, Mobile | No Comments »

Creative Coding Podcast

March 4th, 2011 by Adrian

Creative Coding Podcast

A new podcast has been brought to my attention called the Creative Coding Podcast.

Hosted by Seb Lee-Delisle and Iain Lobb, two names I’m sure you will recognise from the UK Flash scene.

They will be discussing the ins-and-outs of programming for visual and creative applications. The first episode only went out on 30th January 2011, so it is still early days. Give them your support by subscribing in iTunes now.

Here are direct links to the three episodes so far …

Enjoy!

UPDATE – October 29th 2012 – New episodes have been added below …

Posted in ActionScript 3.0, Adobe, AIR, Android, Augmented Reality, BlackBerry, Flash, Flash Catalyst, Flex, Game, Generative Art, Infographics, iPhone, Mobile, OpenFrameworks, Papervision 3D, Physical Computing, Podcast, Processing, Websites | 2 Comments »

Test for Capabilities.screenDPI

January 6th, 2011 by Adrian

With all the interest in mobile development there come the issue of dynamically resizing UI elements based on the pixel density of the screen. For example, if a button is set to be 100 pixels wide, it will appear at different physical widths depending on the device being used. This is because your desktop monitor may have a pixel density (DPI or PPI) of 86dpi but you mobile phone may have a pixel density of 326dpi (as is the case with the retina display on the iPhone 4). This may meant that you nicely designed UI is unusable, with items being too small to click on with your finger!

An article regarding this was posted back in Jan 2010 on the Adobe Developer Connection by Christian Cantrell titled ‘Authoring mobile Flash content for multiple screen sizes‘, and more recently (Nov 2010) a whitepaper by Allen Ellison titled ‘Flash sizing Zen: Making Flash fit on mobile devices‘.

In Christian’s article he mentions using the AS3 Capabilities class and the method screenDPI, however as Renaun Erickson pointed out yesterday there is a problem with the returned value from this method when using AIR on devices.

Here is a little test SWF which shows you what Flash thinks your system is displaying (correctly or incorrectly).

Download a ZIP of the FLA source file here

An image of the various sample sizes can be viewed here

Confirming that 86 pixels equals 1 inch on my 19" (1280x1024) monitor

Here are some useful links regarding pixel density, DPI and PPI …

Posted in ActionScript 3.0, AIR, Android, Bug, Flash, iPhone, Mobile, Sample Code | 2 Comments »

Link to Android App in Marketplace from a Webpage

December 10th, 2010 by Adrian

Android Marketplace

If you have a mobile version of a website you may want to point users in the direction of an app that is available in the Android Marketplace. If so, you can do it like this …

Get the app here

Note: The HREF link is pointing to …

market://details?id=your.package.name.here

Posted in Android, Mobile | 3 Comments »

AIR 2.5 for Android now available on the Android Marketplace

October 8th, 2010 by Adrian

AIR 2.5 for Android

AIR 2.5 for Android has just been formally released and is now available on the Android Marketplace. Which means end-users can now get the runtime and then install your apps created with AIR. Users will need to be running Android 2.2 (Froyo) to see it in the Marketplace.

Ryan Stewart has a blog post with some info on publishing your apps to the marketplace.

Here are some other useful links to help you get started with AIR for Android …

Luckily my iPhone contract has just expired. Android here I come! :-)

Adobe AIR for Android Install Screen

Posted in AIR, Android, Mobile | No Comments »