Very recently I was speaking at a press conference of a new culinary service called Cooklet.com. Okay, you may wonder what was my role in that event. So first of all Cooklet team is located out of Wroclaw/Poland, but this obviously isn’t the primary reason What really brought me there is the fact that Cooklet […]
One of the most common problems with Flash applications are memory leaks, programming flaws that cause Flash Player to loose access to memory that it could recycle otherwise. In the mobile space it’s crucial to understand memory management to get the most out of the Flash Player, and ultimately to ensure a smooth ride for your consumers.
Flash Player memory management
Flash Player makes use of automatic memory management, to help you to create applications with ease and with less code. In fact the Flash Player uses a pretty simple mechanism that determines how many times you have referenced a particular object. Once an object has nothing referencing it then it can be garbage collected – predictably it’s called “reference counting”.
The following is a great example of reference counting in action, notice that I have created a Geolocation object (geo) and added updateHandler as a listener function for update events. This counts as a reference against updateHandler:
var geo:Geolocation = new Geolocation();
The updateHandler function marks the location object null, tagging it for deletion by the garbage collector which is great. The problem is that the location object still has a reference to updateHandler, and therefore the location object cannot be deleted until that function looks like this:
Memory leaks are easy to create in Flash, and even harder to debug later. It’s therefore essentially to build your applications with memory in mind and use all tools at your disposal to keep checking for leaks, slow performance, and run away code.
Flash Builder Profiler
Flash Builder 4 ships with a new feature called the Profiler and in the video below I’ll show you how to use it to solve a memory leak. Now don’t be fooled, this memory leak took a few hours to solve in reality – these aren’t easy problems to solve.
In fact I found two memory leaks, the first is the ExternalInterface.addCallback holding onto a function reference. The other is more complex, and I have marked it “Flash Player Bug” as I believe this is a problem with the runtime itself.
With CS5 now available the EMEA Evangelism team have been hard at work prepping for our upcoming tour and the Online Developer Week. The course of events will fall between June 7th – 10th covering everything from design in Photoshop CS5 to development, and even deployment of your applications using the Flash Platform suite of tools.
The tools covered will include Flash Builder, Flash Professional, Flash Catalyst, Flex 4 and the Flash Player 10.1 and AIR 2 runtimes. In my own session we’ll also be covering Device Central and some asset optimization guidelines for targeting mobile phones.
We’ll also look at P2P with Flash Player 10.1 as well as Livecycle, PHP and Java integration on the backend.
June 7th – 12:00 – 13:00 GMT Erase the Designer to Developer gap: Adding interactions to your design with Serge Jespers
June 7th – 15:00 – 16:00 GMT Connecting your design to PHP services with Mihai Corlan
June 8th – 12:00 – 13:00 GMT Connecting a web application to a J2EE backend using Flash Builder 4 with Michael Chaize
June 8th – 15:00 – 16:00 GMT Working with Flash CS5 components in your Flash Builder 4 project with Mike Jones
June 9th – 12:00 – 13:00 GMT Going multi-user with P2P in Flash Player 10.1 with Tom Krcha
June 9th – 15:00 – 16:00 GMT Developing multi-user applications with LiveCycle services with Tom Krcha
June 10th – 12:00 – 13:00 GMT Bringing web Applications to the desktop with AIR 2.0 with Piotr Walczyscyn
Jun 10th – 15:00 – 16:00 GMT Code once and run on multiple mobile devices with Mark Doherty
We’ve been busy for the past week building “EVA” to demonstrate all of the above. I think you’ll be really impressed with it and of course we’ll be providing the code after for you to use in your own applications.
As some of you know, learning about AIR, AS3, Flex, Flash Catalyst, Flash Builder has been my side-project for a few months now. As I mentioned in a previous post, it is essential to prepare for the future and invest now in learning new skills.
For me, the best way to learn new things is to create a project that’s difficult, yet cool enough to keep you interested. So my first few steps revolved around learning how to use Fireworks, then Flash Catalyst, Flash Builder and ultimately distribute an application using Adobe AIR.
One of the amazing new features of AIR 2.0 is the ability to embed and execute native code from right inside Actionscript, an API called NativeProcess. This means that you can safely run existing services over the command line, as well as install your own native service components. AIR 2.0 is in beta right now on Adobe Labs, and is mobile ready as designed so it’s a great time to get started.
So what would a Platform Evangelist for mobile and devices create?
What is it?
- A packaging utility that can produce SIS packages for Symbian devices
- It targets the Flash Lite 3.x runtime for Nokia’s S60 devices
- It runs on PC and Mac OS, all versions
- The tool has embedded Python binaries inside, compiled versions of “Ensymble“
- For signing purposes the tool also includes OpenSSL for certificate signing
- It is unsupported and without warranty
How do I use it?
- A tutorial from Ms. Myers, reigning packaging queen, is here.
Where can I get it?
I have been hugely impressed with the capabilities provided by AIR, in this only my first AS3 project. Looking back on all of the technologies that I have used has really got me excited about AIR applications on Android, and even sprouted a few iPhone applications in advance of that. Seriously, imagine having all of the power of AIR and this toolchain on mobile phones?
Well I hope your AS3 training is well underway by now..
I thought I’d share a spot of code with you, a new API in the flash.sensors package called Geolocation. The package itself is enabled for iPhone applications (created with Flash Pro Cs5), FL4 and AIR in the future enabling you to create context-aware applications with ease.
The coolest thing is that you can test your applications that feature Geolocation in Device Central Cs5, very cool.
var locale:Geolocation = new Geolocation();
lastLat = e.latitude;
lastLon = e.longitude;
gpsIcon_mc.visible = !gpsIcon_mc.visible;
CES 2010 in Las Vegas saw a very interesting device launch from UK based Light Blue Optics. The great news is that they’ve received really positive press and comments from users that are eager to get their hands on the Light Touch.
So what is it? Effectively it’s a projector for rich media, but it’s laser based which gives it the ability to project onto different surfaces while maintaining a sharp focus and bright colours. LBO used the Flash Platform to provide a rich user interface engine for applications, games, photos and even H.264 video playback. The device is also multi-touch enabled using infra-red, but employs an invisible grid projection onto the surface, which enables much more accurate and speedy response times.
As a user you can envisage a huge array of different use cases, maybe your calendar projected onto your desk, or video playing on your bedroom wall. We saw a huge array of 3D TVs, ever larger, thinner and brighter televisions this year at CES. Could the future require no screen at all?
Just think of the options for this kind of device in the auto-industry, gaming and entertainment. The great news is that the device spec’s make it capable of running Flash Player 10.1 in the future, reaping the benefits of our consistent Open Screen Project runtime for all platforms.
- Adobe Flash Lite 3.1 on WinCE 5
- ARM11 CPU @ 600Mhz
- 10-inch touchscreen with WVGA resolution
- Laser based pico projection
- Infrared multi-touch detection
- WiFi and Bluetooth radios
- 2GB of on-board storage (+ microSD)
Check it out in action:
As many of you heard in my recent e-seminar we have decided to stop work on the Distributable Player beta.
We didn’t take this decision lightly, and as many of you know this product has been my focus for a long time, so I’m a little sad to see it go. However in light of our new strategic direction here at Adobe, it is time to focus all of our attention on the goals of Open Screen Project, specifically with Flash Player 10.1.
The goals of the product were to:
- Enable the distribution of Flash Lite 3.1
- To open up opportunities for application distribution on S60/WM devices
- Provide a consistent platform for development as we work on Flash Player 10.1 and AIR
The solution was a success in many ways, we have had 135,000 downloads of the Mobile Packager to date. We learned a huge amount in building a complex tool and provided a footing for many of you to create mobile applications for the first time. My personal measure of success was that tens of thousands of developers and designers who were able to target mobile platforms for the first time, not to mention the great applications that were created.
Admittedly in some ways the product didn’t quite hit the mark, and we learned a lot from that. In fact the reasons that led us to create the Distributable Player now play a core part of the plan with our Open Screen Project partners. We are each playing a part to drive consistency, establish update mechanisms and enable wide distribution. Nokia has already established an OTA update mechanism for the Flash runtime, which is a great example of their commitment to the community.
Finally, some of you have asked for some guidance on applications that you had planned to launch. As you would expect we don’t intend to simply shut down the delivery mechanisms, so don’t panic.
What will happen to the product now:
- The server solution for device detection and player downloads will remain in place for 1 year (active until November 30, 2010).
- The Mobile Packager tool will be removed from Adobe Labs
- Our Labs pages and discussion Forum will be removed
- I will of course be working with some of you to enable your upcoming launches as planned
Over the summer I have been learning all about Actionscript 3, creating my first AIR application with Flash Builder. My first application was to create a desktop interface for SWFPack.com , and a Mobile phone projector based on demofone.com for my presentations.
Additionally in the past few weeks I have also began work on my first iPhone application built with Flash Professional CS5. It’s an application that I hope we can all contribute to in time with video tutorials called “Flash Training for devices”. The first set of videos will come from Dale’s fantastic video series over on vimeo.com/adobeflashlite .
As we move through the quiet holiday period I would suggest investing in some AS3 books and training, or catching up on the Flash Player 10, Flex and AIR content available at tv.adobe.com . Investing your time now is a great way to ensure that you’re not left behind.
My best advice is the same that I follow myself:
- Set yourself achievable goals for learning this new language
- Create a sample project, one that you can get excited about and share
- Keep communicating your thoughts and experiences, we can all learn together
Here are some sneaks from my sample app to get you warmed up:
I spotted this today on engadgetmobile.com, featuring the guys from QNX, Alcatel Lucent and Eric Snowden from Atlantic Records.
The LTE Connected Car is a platform for in-car entertainment, navigation, management and services. At MAX 2009 QNX won the mobile and devices award because of their excellence in working with the Flash Platform. Working with the geniuses at Alcatel Lucent QNX have enabled LTE connectivity (read: 4G) into the car to prep for a future of wireless networking at 100x the bandwith of 3G (100Mbps in theory).
It is by definition “mobile” but at the same time it’s much more, the platform interface is based on Flash Lite 3.1 running on the RTOS QNX platform with all manner of extensions for GPS, Bluetooth, video playback and even integration into the dashboard. I even spotted Chumby and Kabillion content built-in and QNX are looking for partners here.
* on-demand movies, streamed or downloaded
* access to personally recorded TV programs via cloud storage
* in-vehicle Internet radio and on-demand music stores
* multi-player online gaming
* social networking
* dynamically updateable navigation and location-based services
* GPS augmented by Google Maps’ point-of-interest indicators
Although no-one was brave enough to create the actual dashboard in Flash for safety reasons
Check out the video, and the extremely chirpy and fantastically named QNX CEO Dan Dodge.
Dale has done a stunning job of rounding up the possibilities for Flash applications and content on devices. In summary he covers the Standalone, Browser and Personalization use cases providing examples of various applications. Rather embarrassingly I think I’ve only seen about 30% of these, so hopefully you’ll be able to get inspired by some of this great work..
Here are some samples.. and note the ridiculous hassle to build a video like this. You can see the video series here.
At Intel’s Developer Forum Engadget recorded a demo of an Intel (an Open Screen Project partner) based set-top box running a Flash based user interface and Flash based applications. The heart of this set-top box is Intel’s CE 3100 Media Processor which according to Engadget “combines an 800MHz Pentium M core with a proprietary video processing […]