Why I Picked Adobe Air

Two years ago I started a project called RaceTab, as a meet manager for track & field and cross country races.  For the first two versions of that free software I have developed it using Microsoft Visual Studio .NET and it's been pretty great.  I love Visual Studio for what it is and use it exclusively for the software I write for the service industry.  It is truly a joy to develop in with its easy layout creation and intellisense, among other things.

But one major weakness:  it is not cross-platform.  Sure, sure there's Mono, but the average person can not get that going and some of the best things like the My namespace (Visual Basic .NET) are not available or at least are limited.  So since the most common question I get is "When is the Mac version coming out?" (and I got tired of answering: "NEVER!"), I have decided to develop the next version using Adobe Air.

What is Adobe Air?

In short, it is kinda of like Microsoft HTA 2.0 (for those of you old enough and geeky enough to know what that is!!!).  It allows you to take your HTML/CSS/Javascript skills and use them for a desktop application.  You are essentially developing a web page that runs locally and has access to the local file system like a desktop application.

What about Google Gears?

This is the most common thing that other developers have said to me when I tell them that I'm going with Air.  Because of Google's clout, more people seem to know about Gears.  While they are similar in concept, they are really not the same.  First of all, the approach is totally different.  Google Gears is primarily a way to make your web page available offline.  It runs in a browser and has some cache and a local database to store data so that when you are offline you can still function.  When you get back online it syncs that data back up.  So your program is still living on the web... it is still a web page first.  Adobe Air on the other hand does not run in a browser and does not start with the concept that there is a server you are running off of in offline mode.  It is a desktop application first.

What can Adobe Air do?

You can read and write to the file system.  You can create desktop shortcuts, associate file types with it, create task bar items, create native program toolbars, native file save/open dialogs, etc.  Pretty much everything that you can do with a .NET application.  Usually you are going to work with a SQLite database to store the application data and Adobe Air ships with built-in functionality to converse with it.  You have access to all of the same javascript language that you are used to on the web, but it has been extended with additional features for the desktop functionality. 

It is built on top of the Webkit (think Safari and Chrome) codebase so it renders HTML beautifully.  A really really wonderful change from developing for the internet is... YOU ONLY HAVE TO WORRY ABOUT ONE BROWSER!  Since everything is viewed through the eyes of Webkit, you just have to make it look good and work in that browser.  No more hours of testing.  That also means you can use Webkit-specific CSS and Javascript without feeling guilty about it or doing hacks.  Webkit has some nice things like rounded corners in CSS that you should check out.

What sucks about it?

I guess Adobe was trying to make things secure.  So they put this thing in a little sandbox, which is fine.  But they also implemented some security features which are very frustrating at times.  You try to do some innerHTML calls or other write functions to make the page dynamic and interactive and BLIP... Javascript security error.  They were concerned with essentially code-injection attacks I guess and so disabled certain abilities.  That means sometimes you have to find creative work arounds and also means that it breaks many of the cool javascript library tools and controls from Dojo, Ext, and others.  I found even the libraries that claim they support Air aren't easy and you have kind of hack workarounds still to get it to go.  I HATE THIS, ADOBE!

It's good that they thought of the users, but they need to trust the developers.  We are not developing web pages.  We are developing applications.  And if you create Air with that premise then you need to treat it like an application.  Microsoft doesn't put limitations on .NET applications... it's up to the developer of the application to be smart (and not malicious themselves of course) and the user to only install applications they trust.  Adobe, I feel, kind of treats us like children in this case.  I hope they lift these restrictions.

Where to Start

Start out on the Adobe Air web site and start reading.  There is some good documentation online, but not enough of it.  So I actually went out and picked up a book.  It was the only Air book at the bookstore so it wasn't that I necessarily researched and looked through them and picked out the best one, but I did buy Adobe Air for Dummies and it is decent... although it wouldn't have been my first choice if they had all of the ones I saw on Amazon at Borders.  Oh well.  It helped me though.

Get Coding and Best Practices

The first thing you should probably decide on is what Javascript library (or libraries) to use, because you will need them!  If you don't use one then your interface is going to be pretty flat.  It's nice that it's like a web page, but you want to make it more like a progressive web page or a web-desktop hybrid application.  Standard HTML tools just don't let you do that... so get yourself a library.

Which did I choose?  Actually after experimenting with a few different ones and being frustrated with them for various reasons (the biggest reason being that certain features didn't work with Air's security constraints), I decided to write my own.  I am still early on in my Air development, but I will probably release my Javascript platform on this site at some point.  I am calling it "My" (inspired by the Visual Basic .NET My Namespace) so I address things like My.Air.Database and such.  It has tools for file management, database connection object, and also non-Air specific things like DOM tools and user interface dialogs and such.  I think it's going to be a good project that people will like, taking my background from a number of technologies and melding them.

Okay... next... each "screen" in the program is going to be an HTML file.  I view this like a form in Visual Studio.  So what you want to do is have three files for each screen:  the html file, a javascript file, and a CSS file.  Name them all the same and put them in the same directory.  Visual Studio does this, even if you don't see it, to separate the design for the code.  We are doing the same thing... the content and structure are the html file, the CSS file does the design, and the code is exclusively in the js file.  Don't get tempted to put ANY javascript code in that html file.... no, not even onclicks.  I don't even have any href values in the html.  All actions the form takes should be defined in javascript.  All design elements should be defined in the CSS.  Period.

That does not mean of course that you can't have a master stylesheet as well that does some common styling elements across your entire application.  Totally.  Do that too.  But keep the separation of structure, design, and logic separate and you'll be happier in the long run!

Another definite "do" is to utilize namespacing and javascript objects.  Don't take the easy route and just do your typical javascript functions.  Do it right now and keep your application clean for later.

Alright... that's it for now.

Comments

  1. You should try writing Air apps in flex builder. You'll never want to use anything else. The controls and layout features available in flex are money. Even if your content is primarily html, you can have an html component and cross-script to have the flex controls manipulate the html content with javascript. If you're creative, you can do some crazy cool stuff in no time.
  2. I totally love this article. I think you could write some other things to make your blog more complete.For example: ed hardy clothes.vibram p90x workout . mbt.ed hardy shirts.vibram five fingers kso trek.mbt sapatu shoes. cheap ghd straighteners ugg boots discount ugg boots cheap replica louis vuitton handbag ed hardy I thought that many people can like.
  3. Tiffany jewelry manufacturers directory,cheap jewelry - lots of registered importers and exporters. Cheap tiffany jewelry manufacturers, Tiffany & co jewelry suppliers, tiffany jewelry wholesales, Tiffany Watches,exporters, sellers, traders and gold tiffany jewelry Distributors from China and around the world at www.goldtiffanyjewelry.com Tiffany jewelry exporters, Tiffany Accessories, Tiffany Bangles, Tiffany Bracelet, Discont Tiffany Bracelet, Discount Tiffany Cufflinks, Fashion Tiffany Earring, Tiffany Necklaces , Discount Tiffany Necklaces, Tiffany Rings, Tiffany Watches
  4. These well-known UGG Classic Cardy are now becoming more and more fashionable and popular, to some extent. I believe you may ask what the shoes can bring us. As I know, if one person struck by lightning in Holland, his family must put all his Classic Cardy Boots up as soon as possible. And in the fairy tale, the shoes are more magic indeed. Now, I always say that the UGG Classic Cardy Boots are so magic and popular.
  5. Officials at the dolce & gabbana replica handbags Postal Service, source of the bally handbags most complaints, say employee complaints chloe handbags replica recently fell by 77 percent in three tod's handbag regions offering mediation.Timely replica handbags . Trendy. Brand name watches dior handbags are more than a luxury; they're replica burberry handbags an obsession with Ashford.com. bally replica handbags Only the most fashionable, reliable timepieces burberry replica handbags will do. All 100% authentic cheap Handbags with serial numbers. All Mulberry handbags brand-new.Brand name watches in stock. replica chopard 30 days satisfaction guaranteed! concord for sale It's a passion that began in 1997 Tudor for sale , and a legacy that has made Ashford.com one Alain Silberstein for sale of the largest, most trusted swiss watches dealers online. With over 3,000 luxury omega replica to choose from priced way below Tudor replica retail, plus a stunning selection of replica Glashutte jewelry, it's no wonder. Movado, Ebel, replica DeWitt Bulova, Cartier, Gucci and more are replica Glashutte available among 40+ top brands, all with dior replica handbags free shipping.
  6. Tiffany Jewelry itself has no problems in Tiffany & Co quality. Now in the Tiffany Jewellery market, there are many kinds of replica Discount Tiffany Jewelry silver Tiffany Silver Jewelry. If you don't mind replicas Tiffany Silver, that's ok. If you don't want replicas Silver Jewelry, then how to choose a reliable Tiffany UK supplier is pivotal. After all, no one wants to get the fake Tiffanys with a lot of money. Among silver Tiffany's, Tiffany 1837 is the hot pick of many people. Cheap Tiffany is a brand name around the Discount Tiffanys world. Whether used as a gift or Return to Tiffany bought for oneself, Tiffany jewelry will never make people embarrassed Tiffany and Co. As a big brand in the Tiffany Co world, the quality is Tiffany Co Jewellery out of question. The after service of Tiffany Co Jewelry silver Tiffany Discount also assures people the reliability of Tiffanys Jewelry.
  7. High quality replica handbags Louis Vuitton handbags Gucci handbags Prada handbags Hermes handbags Burberry handbags Chanel handbags Designer handbags Each replica handbags designer handbags Louis Vuitton handbags Chanel handbags gucci handbags Cheap replica handbags In the my Louis Vuitton handbags store buy cheap Gucci handbags Prada handbags replica Hermes handbags You best choice replica Chanel handbags For Sale! Thousands of quality replica handbags Louis Vuitton handbags Looking for replica Gucci handbags Prada handbags Designer handbags chanel handbags more than 5000 replica designers handbags Replica Handbags replica rolex replica watches replica Handbags,replica watches,designer handbags Louis Vuitton handbags replica watches replica rolex is a very common word in our daily life,It helps large number of ladies achieve their dreams.Beauty is human mature.Everyone would like to be elegant,fashion,eye-catching etc.seo In a word,everyone wants to be perfect.So almost all of us like to have a designer handbag,it can reflects someone more chic,attractive,beautiful.This is an era that everyone has a cell phone,replica watches there was a lot of people worry that watch has withdrawn from this era. A new generation of watches in addition to functionality, the more important features should be innovative and fashion.replica rolex replica watches replica Breitling replica Bvlgari replica Hublot replica iwc replica Omega replica Tag Heuer U-Boat watches swiss watches Rolex watches rolex replica replica rolex Breitling replica Bvlgari watches chaumet replica iwc replica Tag Heuer replica Omega replica U Boats watches Let me into your watch swiss rolex , listen to your heartbeat close to the arm, the first time with you to be happy, like you slept deeply at night, with you every second, let my heart as you countdown, ticking is my prayer.You have a Swiss watches swiss rolex brand ultra-low range. Quality assurance

Leave a Comment