I just finished writing a simple compass application for AIR 3 that uses an ANE (AIR Native Extension) to get orientation data from the Android operating system. All the code (AIR application, Java native extension, and "glue" library code) is available on Github if you want to see how it works.
Device speaker selection. Play audio through a phone’s speaker, or through its earpiece.
Background audio playback on iOS. Keep audio playing in the background when a user switches away from your application, and even when the screen is switched off.
Device Speaker Selection
Toggling between a phone’s speaker and earpiece for playing audio is as easy as setting the audioPlaybackMode property on SoundMixer like this:
// Play audio through the speaker:
SoundMixer.audioPlaybackMode = AudioPlaybackMode.MEDIA;
// Play audio through the earpiece:
SoundMixer.audioPlaybackMode = AudioPlaybackMode.VOICE;
Background audio playback has always worked on Android because of the nature of the Android’s multi-tasking implementation. Starting with AIR 3, it works on iOS, as well. To allow audio to continue playing when your application is closed — and even when the device’s screen is turned off — add the following to your application descriptor:
If you’ve built iOS applications using AIR for iOS (also known as the Packager for iPhone in Flash Professional), you may have come across an inconsistency in icon sizes. According to the iOS Human Interface Guidelines, Apple says you need a 50×50 icon for iPad applications (for use in Spotlight search results), but AIR doesn’t support 50×50 icons. Instead, we support a 48×48 icon both on the desktop, and for the iPad. There are two reasons we stuck with the 48×48 icon size rather than 50×50:
Apple trims a one pixel border from the icon in order to add a shadow, so the icon is really 48×48.
Since we already support 48×48 icons for the desktop, and since Apple turns your 50×50 icon into a 48×48 icon anyway, we figured we should just stick with the 48×48 icon.
Unfortunately, there’s one problem: Apple is currently trimming the one-pixel border off the 48×48 icon, so your 48×48 icons are actually 46×46. The good news is that this is a known issue and we’re fixing it in a very cool way. Rather than supporting 50×50 icons, we’re planning to continue to support 48×48 icons, but we will add a one-pixel border around the icon for you which Apple will then trim off. That means you can design your 48×48 icons without having to worry about the fact that you are going to lose two pixels in both dimensions.
I can’t say when this fix will be out just yet, but I can confirm that it’s in the works.
If you want to build an AIR application that targets both the iPhone and the iPad, it’s easy. Just follow these steps:
1. Make Sure Your Application Scales
First and foremost, make sure your application will scale properly. Tips and tricks for making your content scale across screens is a topic for another post, but avoid obvious pitfalls like using a background bitmap scaled only for the iPhone’s smaller screen. Assuming your application is designed to scale properly, read on.
2. Specify the UIDeviceFamily
In your application descriptor, add the following as a child of the application tag:
After watching this excellent MAX session by Julian Dolce, I decided to see what it was like developing AIR applications for the BlackBerry PlayBook using the BlackBerry Tablet OS SDK. As it turns out, the experience is great. It’s very easy to get started, and everything worked as expected. I went from nothing to a fully configured development environment and a working application in just about an hour.
If you’re interested in getting started developing for the PlayBook using the BlackBerry Tablet OS SDK, I recommend the following:
I’ve been playing around with Android recently, and I ran into a situation where I needed to take screenshots of applications running on the device (as opposed to on my desktop with the emulator). Most of the information I found on Google recommended that I install a third-party application, but I learned a quick and simple way to do it without having to install anything.
Assuming you have the Android SDK installed (which, if you’re doing development, you obviously do), simply:
Connect your Android device (I’m using a Droid) via USB.
Run android-sdk-mac_86/tools/ddms (hint: put the tools directory in your path to make your life much easier).
Select the device in the Dalvik Debug Monitor.
Type Control + s, or go to Device > Screen Capture.
Not quite as easy as taking screenshots on the iPhone (simply press the power button, then the menu button at the same time), but if you need the screenshot on your desktop rather than in your photo album on your phone, it’s a very efficient solution.
Bill Perry Jonathan Duran is going to be giving an free online seminar this Wednesday on the new mobile features in Flash 8. From the site:
Join the Macromedia Mobile and Devices product team for a live, 90 minute online seminar and learn how you can develop rich, engaging, and easy-to-use content using the new mobile authoring features in Flash Professional 8.
The morning slot is already filled, but there’s an evening slot (9:00PM – 10:30PM Eastern) that still has some openings. If you’re interested, better hurry.