Bill Howard announced that Flash Workers would be available for Android in an upcoming Beta, and here it is! The Adobe AIR 3.9 SDK introduces Workers on Android. Since I have my AS3-Workers-Compat library and testcase just sitting around, I thought I'd give it a spin on Android using AIR 3.9.
This library was originally designed so that code could be written (using pseudo-threading techniques), and it would compile and take advantage of Workers dynamically on the client if they were supported. It would work in Flash Players that supported Workers or not, all from the same SWF. Now, since Workers will be supported on Android before iOS, it would appear the library will be useful for creating code that will run on threads with Android and pseudo-threads under iOS.
Indeed, it does work as you can see by the 3.9 screenshot below. I didn't have to make any code changes - just setup the 3.9 compilation steps. In the 3.6 screenshot, you can see that the counting process is taking up time on the main rendering thread, so the radar animation is choppy.
Smooth radar animation with Workers compiled with AIR 3.9
Choppy radar animation without Workers compiled with AIR 3.6
I've checked in my build files for Android into the AS3-Compat-Workers demo projects on github. Feel free to play along. I'll be testing performance and the impact and tuning of the pseudo-threading scheduler.
I'll be following this development closely as threads on mobile is a huge boon to the Adobe AIR and Flash platform. Hopefully iOS will follow, though Bill indicated this would be much longer in the works.
Here are the APK files for download:
WorkerCompatTest_3.9.apk - workers
WorkerCompatTest_3.6.apk - no workers
I'm also toying with the idea of creating a simple, cross-platform mobile development script. It's easy to switch between AIR versions using the command-line. And with Scout for profiling and the AIR SDK for compilation (xmxlc), simulation (adl), and packaging (adt), just add your favorite text editor and you have a fairly reasonable development environment.