QueTwo's Blog

thouoghts on telecommunications, programming, education and technology

Monthly Archives: October 2011

Creating a Windows AIR Native Extension with Eclipse – Part 2

In part two of this video series, I go through how to actually program your ANE Windows DLL.  This involves doing some C programming.  Please see part 1 here.

The snippets mentioned in this video are available here :  ANE Snippets Download     You can use these to jump-start your development.

Creating a Windows AIR Native Extension with Eclipse – Part 1

The second I heard about Adobe giving us the ability to create our own extensions to the Flash Platform in AIR 3.0, I was smitten.  It was finally a way that we could add our own features and do the things that were high priorities on our lists, but not on Adobe’s.  I knew I was looking for features that were one-offs (how many people today really need access to the COM ports), but they were forcing me to do all sorts of weird workarounds like launching proxy applications to do seemingly simple tasks.

AIR 3.0 got released a few weeks ago and I’ve jumped in head first into creating some ANEs (AIR Native Extensions).  For those of you who don’t know, ANEs are packaged extensions that contain operating-system specific code (DLLs for Windows, Libraries for MacOS, Java classes for Android and Objective-C for iOS), that allow you to do things that the Flash Player wasn’t able to do. 

Unfortunately, Adobe assumed that if you were developing DLLs for Windows, you were going to be using Visual Studio and nothing more.  This didn’t make a whole lot of sense in my mind as they’ve been leveraging Eclipse for all of their tooling, and Eclipse does offer some great C/C++ addins.  Now, that being said, Visual Studio is by far the more feature-full and hands-down the best editor for enabling these kinds of workflows on Windows.  It is, however, very costly and even though Microsoft offers a free versions, it takes over your computer by installing debug versions of most of Microsoft’s shared libraries making your computer slower and more crash prone.

I wanted to use Eclipse’s CDT addin with the standard GCC tooling that is available on pretty much every operating system.  By using GCC, I was able to make very portable code that with minimal effort was able to compile on all three of the major OSs (Windows, Mac, Linux). Adobe’s documentation was little help in getting this going (even if you were coding in Visual Studio, there is very little guidance on how to get things setup).  I do have to note that with my setup there is one distinct disadvantage — the lack of ability to debug the DLL when it is launched from AIR.  You will have to write your own C/C++ harness to do testing on your code in order to test it.  If you use the Visual Studio tooling, you CAN debug any DLL while it is running (this is why Microsoft replaces the shared libraries on your system to allow that debugging).

I’ve created a four part video series documenting how to get going creating ANEs.  Part 1 covers setting up your environment, including installing CDT, the compiler, and getting Eclipse setup to do your programming.  Part 2 covers actually coding the C/C++ code for your Windows DLL.  Part 3 covers creating your ANE, and packing up all the stuff needed to make it work.  And Part 4 covers how to use your new ANE in an AIR project.

My Presentations at Adobe MAX 2011

This year I had the distinct honor of being asked to present at Adobe’s MAX conference.  The conference was an absolute blast.  From the Keynotes to ALL the other sessions I attended, the thing went off without a hitch.

I gave two presentations this year — one for the 360|MAX Unconference and one for the Develop Track at MAX. 

Getting Data From Here To There (with Flex)

This session was not recorded, but fairly well attended.  You can see my slides here.   In this session I talked about the different communications methods available to Flex developers, and I started to lay out a basic matrix of when to use what type of communication method, and what the pros and cons were of each type.  Not all of my demos worked due to a broken J2EE server, but I think everybody got the idea.  I don’t have great downloads for that presentation as most were specific to my server setups.

Getting Physical With Flash (Hardware Hacking)

This session was a blast to present.  We had about 140 people in the room who seemed to be really into it.  I presented on integrating the Arduino hardware prototyping kit into Flash/Flex in addition to showing how to integrate the Microsoft Kinect into Flash/Flex. I came armed with about 6 electronics projects that I showed people to inspire them to create their own.

Video Player - MAX 2011 Preso

You can download the PPT here.

You can find most of the downloads featured on my blog, but I will update this post and post the direct links to everything at a later date.

Thanks again to the entire MAX staff for making the show run so smoothly from both the speaker’s perspective and from the attendee’s perspective.  A+ work led to an A+ experience :)

Follow

Get every new post delivered to your Inbox.

Join 27 other followers