Home >
This is my third and last entry on using Aptana to build jQuery based AIR applications. Please be sure to read part one and part two. The two earlier entries discuss how to create your project and walk you through the basics of building out the application and creating the installer. This entry will round things up by discussing how to create badges for your AIR application.
Badges are probably one of the coolest features on the AIR platform. It's a simple thing really. Provide a way for folks to easily download and install your application. But when you consider "normal" application installation, it really is a lot simpler. With one click you get the bits and immediately run the installation. It can also take care of installing the AIR framework, or even update the framework if it needs to be!
Ok, so let's get working. I'm going to assume you already have your AIR project created in Aptana. You begin by clicking the "Open Badge Exporter" icon.
This will prompt you for the project and application descriptor to use. If you were already working in the project, it should default correctly (it looks as if the title of the window is a bit off):
This will then open a new page in Aptana with many options. At minimum you should probably create a new folder for the badge export. You also want to specify an Application URL that points to your AIR file. Aptana will use a default image for your badge, but I recommend making something fresh. I found a nice image at this blog entry, and hopefully the author doesn't mind me using it. Two things to note here. The Image URL is a relative image path and for testing, you will want to put it in the same folder your badge is being exported to. You aren't given any real direction on what size the image should be. I checked Aptana's default image and saw it was 205 pixels wide, so I shrunk down the image to that size. For the heck of it, I made one more quick modification. Under Badge Text I changed the Install Button text to something more descriptive for my application.
Now just click the big Generate Badge button. This will spit out the HTML, JS, and images necessary for your badge. I quickly switched to the browser preview to confirm it worked:
Woot. That's all there is to it. Of course, you probably want to upload the badge as well. The HTML generated is, unfortunately, a complete HTML page. That's not a bad thing per se, but if you want to do the bare minimum cut and paste (just the JS library and just the HTML tags you want) then you will have to do a few of them. It would be nice if the exporter had a "minimal HTML" option.
I've uploaded the HTML here: http://www.coldfusionjedi.com/downloads/badge/index_badge.html. It isn't on a page with other content, but if you view source, you can see that it wouldn't be too difficult. And you have to admit - the installation from this badge works great. Aptana has really done a stellar job here!
More in This Series







Facebook Application Development
Comments
Leave a comment