Archive for April, 2010

Porting an AIR Application from iPhone to Android

I recently decided to port my AIR Twitter client called TweetCards from iPhone to Android. The process primarily consisted of:

  • Resizing assets to compensate for the larger and higher resolution screen.
  • Changing the orientation of the application from portrait to landscape (to take advantage of the higher resolution screen).
  • Adding keyboard controls to take advantage of the D-pad on the Droid.

The entire process probably took about six hours tops. Below is a video of the end result.

Continue reading…

Installing an AIR Application on Android

Now that AIR and Flash for Android are in private beta, I thought I’d show the process of turning an AIR application into an Android app. The process is incredibly simple and fast, and the end result works great.

(Apologies for the shaky camera work — I had to film this one all by myself.)

Continue reading…

A Third Kind of Orientation: Head-to-Head

Digital board games are going to be big. If you have any doubt, just check out Scrabble on the iPad. But to get the most out of digital board games, I think we’re going to need a third orientation mode in addition to portrait and landscape: head-to-head, or simply flat.

Of course, you don’t have to wait for devices or operating systems to support a third orientation mode. As long as you have access to the accelerometer, you can program head-to-head mode yourself. Below is an example of why a "flat" orientation makes sense (as well as a demo of iReverse running on a Lenovo X201 multi-touch laptop).

Continue reading…

Simple Accelerometer Example

I’m adding some custom accelerometer/orientation behavior to the iReverse game I’m working on, so I threw together a simple test app to output accelerometer data. I figured I’d post the code in case anyone else was working on something similar.

Code and screenshot below:

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.AccelerometerEvent;
    import flash.events.Event;
    import flash.sensors.Accelerometer;
    import flash.text.TextField;
    import flash.text.TextFormat;

    public class AccelerometerTest extends Sprite
    {
        private var textFormat:TextFormat;
        private var output:TextField;
        private var accelerometer:Accelerometer;

            public function AccelerometerTest()
            {
                super();
                this.stage.scaleMode = StageScaleMode.NO_SCALE;
                this.stage.align = StageAlign.TOP_LEFT;

                this.textFormat = new TextFormat();
                this.textFormat.color = 0x000000;
                this.textFormat.font = "Helvetica";
                this.textFormat.size = 20;

                this.output = new TextField();
                this.output.defaultTextFormat = this.textFormat;

                this.stage.addEventListener(Event.RESIZE, doLayout);

                this.accelerometer = new Accelerometer();
                accelerometer.addEventListener(AccelerometerEvent.UPDATE, onAccelerometerUpdate);
            }

            private function doLayout(e:Event):void
            {
                this.output.width = this.stage.stageWidth;
                this.output.height = this.stage.stageHeight;
                this.output.x = 0;
                this.output.y = 0;
                this.addChild(this.output);
            }

            private function onAccelerometerUpdate(e:AccelerometerEvent):void
            {
                var str:String = "x: " + e.accelerationX;
                str += "\ny: " + e.accelerationY;
                str += "\nz: " + e.accelerationZ;
                this.output.text = str;
            }
    }
}

One Application, Five Screens (Including the iPad)

This morning, I was able to validate a concept I’ve been working on for a couple of weeks now: running one application — completely unchanged — on five different screens:

  • iPad
  • iPhone/iPod touch
  • Motorola Droid
  • Desktop (Mac, Windows, and Linux)
  • Browser

The application is called iReverse, and it’s is a fully functional Reversi game (complete with a pretty decent AI). Although iReverse is fun to play, the most amazing thing about the project is the fact that it runs in all these different environments completely unchanged. In other words, the exact same code base is used to build versions for five different environments. There’s no other platform in the world that can boast this level of flexibility — not even close.

All of these versions are running on AIR technology except for the browser version, but since I didn’t use any AIR-specific APIs (game persistence is done through Local Shared Objects rather than files), it runs entirely unchanged in the browser, as well.

Check out the video and screenshots for more information. In the next couple of weeks, I plan to release all the code for iReverse, and an article describing everything I learned about writing a truly multi-screen application.

Continue reading…

New Version of Squiggly Released

Adobe’s Linguistic Services Team (what a great name for a team) recently released a new version of Squiggly — a free spell checking engine for the Flash platform. This update includes the following features:

  • Support for Spanish, Italian, and Portuguese.
  • Support for Hunspell (i.e. OpenOffice and Firefox) format dictionaries.
  • Ability to translate or customize context menu strings.
  • Bug fixes.

As platforms like OS X (which has built-in universal spell checking), and browsers like Firefox and Chrome become more popular, I think more and more people are expecting applications to have spell checking built-in. It’s great to see that Squiggly is providing a low-barrier solution.