AIR 2.0 Web Server using the New Server Socket API

After exploring Java integration using the new Native Process API (here and here), Excel integration using the new file.openWithDefaultApplication(), and the new Microphone API, here is another application I wrote, this time to explore the new Adobe AIR 2.0 Server Socket API.

The “Mini AIR Web Server” is a simplistic implementation of an HTTPServer. Needless to say that it is far from being a production quality Web Server. The goal here is simply to use the well understood mechanics of a web server to learn how to use server sockets in AIR 2.0.

Installation Instructions

  1. Download the AIR 2.0 beta runtime here.
  2. Download MiniAIRWebServer.air here.
  3. Double-click MiniAIRWebServer.air in Explorer or Finder to start the installation process.

To test the application, open a browser and test the sample HTML pages provided with the application:

NOTE: You may have to change the port number in these URLs depending on the port number you enter in the application.

[Read more...]

Embedding Tomcat and BlazeDS in an AIR 2.0 Application

In my previous post, I demonstrated how to create a simple Tomcat Launcher using the new AIR 2.0 Native Process API. The assumption in that sample was that Tomcat was already installed on your machine.

In this new sample application, I’m taking that idea a little further by embedding Tomcat as part of the native installer. The first time you run the application, Tomcat is automatically copied to your applicationStorageDirectory from where the AIR application starts it. In this sample, I still provide a simple console for the user to start and stop Tomcat manually, but in a real life application, you would probably want to start Tomcat automatically when the AIR application starts.

[Read more...]

Tomcat Launcher: Sample Application using the AIR 2.0 Native Process API

I have been playing with the new Native Process API of AIR 2.0, and here is a first sample application I wrote. “Tomcat Launcher” is like a mini Tomcat Console that allows you to start / stop Tomcat and view the standard output log without opening a DOS box or Terminal window. It also allows you to open that log in your default Text Editor which is another new feature of AIR 2.0 that I already explored in my “Open in Excel” sample application. Tomcat Launcher also provides a generic example showing how to use the AIR 2.0 native process API to execute Java code.

[Read more...]