Today I am attending the Adobe AIR bus tour in Denver Colorado. This free conference is to promote the Adobe AIR product. My plan here is to keep a timeline of notes here as the conference progresses. Expect things below to be choppy because I’m typing as I hear interesting things. I will be posting this live from time to time today and my plan is to come back later and clean this all up. Good Luck!
The Adobe Integrated Runtime (AIR) is a cross-operating system runtime that allows developers to leverage their existing web development skills in HTML/Javascript, Flash or Flex do develop applications for the desktop.
[9:50am] We are here
Well, after Thornbery almost got us crushed by a train on the way here we finally arrived. The conference is about to begin and I have been digging through my swag. So far it looks like I got a T-Shirt, an O’Reily pocket guide on AIR for JavaScript Developers and a CD full of adobe software and examples. fun fun! So far I have been installing all the AIR applications that came on the CD.
[10:00am] Introduction
Here we go. Introduction to Adobe and AIR. 8 million flash player downloads of the flash player each day. Flash is on 90% of the PCs out there. AIR combines flash and html into one platform so you can apply flash effects to your html objects. AIR has a built-in database which allows you to port web applications directly into the AIR application. AIR is about extending what your web applications can offer.
pownce … example. site to allow you to communicate with your friends and conversations/files are shared online and accessible later. The AIR app allows you to do this from the desktop and see online.
finetune .. example. Social networking radio website based on flash. Rather than listening to music over the browser, they wrote a desktop app for their website so you can listen without the browser that you close all the time. Very little code changes to implement. You can search on the website, then you get the option to play on desktop or the web … if you have the desktop app open. The desktop is an extension of the website.
buzzword… word processor with flex and AIR. Nice menus! Check out later! you can write offline or online. This very impressive looking application is still in development and is not accessible to the public. The link for buzzword goes to their information site.
[10:24am] Technical Deep Dive
Before they get started, they want everyone to know about their AIR development contest. For information go here. What is a Herman Miller Aeron chair? They keep going on about how cool this chair is as a prize for this contest.
You can build AIR applications using flex/flash or html/javascript. The runtime is an engine that can integrate flash and html in the same application. HTML get’s rendered into flash using just HTML. Sessions later today to demonstrate this. WebKit is the Open Source Engine used to support HTML in AIR. Adobe does not own WebKit, but they picked it so they could feed the open source community with their efforts.
Now we are going to see how to take a flex application to AIR. Cool, they are using FlexBuilder 3. Time to get that. Flex Builder 3 will allow you to change between the different runtimes… so you can build older stuff for work and newer stuff for home. Sweet.
Now they are reviewing the application.xml file that defines an AIR application. The rootContent tag in the AIR xml file is where you set the attributes to turn your web application into an AIR application. The systemCrome attribute sets how the application to look. ’standard’ will make it look like a OS window. If you set it to ‘none’ then you won’t have any container. Couple that with a transparent background and you have a see through applications for a custom look. The visible property states if the app should show or not when it boots. You can use this to hide the app why it opens, then once it’s ready set it to true and you can see it again.
How do you distribute the AIR application? They go out as .air files. There is a web based “ExpressInstall”. You can have a badge on your website that will allow you install your app and will get the runtime installed if needed. I need to research that more. That is the first I have heard of that. example. howto.
Icons. You can set the icons in the application xml file. There are four entries for different sizes … can ignore all but the largest and AIR will scale it down if needed.
You can change the .air to a .zip and see inside it … until next release when the .air files will be signed.
Resources:
Numerous times now I have heard them say “Just go to google code and grab it”. Does google offer a shared code repository. What do these guys NOT do? I will need to look into that.
[11:02am] HelloWorld AIR application using JavaScript and HTML
You do NOT need flash or flex to build an AIR application. AIR is built into the Flex SDK. There is a stand alone SDK for HTML and JavaScript.
Binaries in the HTML SDK are ADL and ADT. ADL allows you to test the application with packaging the AIR application or installing it. The ADT is the packager. It will create your AIR program and get it ready for deployment. You can find an example of the “Launch Badge” and “AIR Icons” in the html SDK. You can find the templates in the html SDK generated in the flex world in the html SDK too.
Now I’m watching the speaker write an HTML file in TextMate. Moves into the sdk directory in a shell and into the bin dir.
./adl -help will give you help. Basically, you open the application.xml template, make a new copy and do exactly what you would do in Flex. You then use the .adl to compile the application. The only difference is that the source is html and not mxml.
Now he is moving out of TextMate and into DreamWeaver CS3. You can author AIR applications in DreamWeaver CS3. Weaver being Adobe’s signature HTML suite. You can package from DreamWeaver as well. Basically, you not flexing it but your going old school html, DreamWeaver is their FlexBuilder.
Now he is writing an html page that has a form. The content of the textfield on the form when saved button is clicked will write to the disk. The javascript that leverages AIR is:
1: var file = runtime.flash.filesystem.File.desktopDirectory.resolve("dever.txt");
They have an JSAliases.js file to make javascripting codeing easier so the next line is leveraged using that js file. That javascript file in the sdk creates references .. so no you can use air and not runtime.flash.filesystem…etc
1: var stream = new air.FileStream();
2: stream.open (file, air.FileMode.WRITE);
3: stream.writeMultiByte(name, air.File.systemCharset);
4: stream.close;
Aptana IDE - Eclipse like IDE for HTML and JavaScript editor. Not an Adobe product but has an AIR plugin. This has a ton of “samples” that show you how to do the javascript in AIR. Very interesting if you have to live in HTML and not Flex. This IDE could be the bomb.
Now I”m seeing an AIR version of Meebo. It is just an AIR application that slurped up the existing Meebo site. Boom just like that Meebo on the desktop.
[11:43 am] AIR application that contains HTML and Flex
This technique is called ScriptBridging. There is an HTML tag in AIR that you can access in flex. This is basically show this page in HTML here. So, the example I’m seeing now is a Flex program that has an HTML component in it. We are going to write script that can touch inside the HTML object and set data. This is EXACTLY what I could not pull off in Flex 2.0 a few months ago. Here is the function he is writing to access the HTML stuff.
He named HTML component web. The web object has a javaScriptDocument and javaScriptWindow objects in the component. You can access and manipulate the dom directly. So you can access old school javascript items from these document elements.
1: public function doSet(event:Event):void{
2: var dom:Object web.javaScriptDocument;
3: var inputs:Object dom.getElemtnByTagName("input");
4: inputs[0].value = "Denver";
5: }
Cossdomain.xml does not come into effect with this HTML component in the AIR libraries. That was Flex to HTML … now lets go HTML to Flex….
Now we are looking at the html example from the last demo. Technically we already did this in the last demo because the file I/O is in really Flex under the covers. He has now loaded a file to review… It is all HTML and javascript. Examples again how to access the file system. Examples how to access the icon of a file and smush it into a bitmap. He then uses a PNGEncoder to convert the bitmap. The PNG encoder is found in library.swf found on google code. It was imported as a swf as if it was javascript. He can call those functions in the swf and they just run like they were javascript functions. If I had a margin, I would write WOW in it! You can just run functions written in flex by just including the swf in the html file.
Now were are seeing a flex/html application. As people write in flex control, that is piped into the html dom so it can be displayed in HTML which can do things easier such wrapping text and with different colored sections of text. The application is called AIR Chat. You can find it online to chat with the guys on the bus. They use Amazon to deploy this on some free service … maybe a pay service. If the load gets too big, he can just boot more copies on the Amazon servers.
Lunch
Yum! Lunch was really good. They had lunch catered in and they barbequed on the patio. Burgers, brats, grilled corn on the cob. Stopped by the game room after lunch and demonstrated my superior skills at Guitar Hero before I started hunting for a power outlet so I could charge my PC for the afternoon sessions. WOOT! this is fun.
[1:16 pm] AIR API Overview
Daniel Dura, Platform Evangelist, will be talking about his favorite AIR APIs. He will be talking about the top 5 APIs you will probably want to start working with right away.
WindowAPI allows you to create native windows as well as multiple window types. You can control the z-order or make a window stick to the top. An example of this is PixelPerfect. Here is some code we are reviewing…
1: var options:NativeWindowInitOptions = new NativeWindowInitOptions();
2: options.type = NativeWindowType.NORMAL;
3: // LIGHTWEIGHT || NORMAL || UTILITY || NONE
4: var window:NativeWindow = new NativeWindow(true, options);
5: window.stage.addChild( new airLogo
Each window has their own stage. NORMAL would be like a standard window. LIGHTWEIGHT would be like an outlook message in the bottom corner. NONE would be transparent.
FileAPI You can use the native file browser to access files with the FileAPI.
1: var file:File = new =File();
2: file.browseForDirectory();
3: file.browserForSave();
4: file.browseForOpen();
htmlAPI You can use HTML content even javascript content. Much like we saw before lunch. The javascript, dom, actionscript are all shared references. You can pull javascript functions into flex as well. No need to convert a library from javascript to actionscript. You can over ride html behavior. So if the html does a window.open() you can do something else rather than what html would normally do.
DragAndDropAPI.
1: var transferFormat:TransferableData - new TransferableData();
2: transferFormat.addData(http://www.sutibo.net, TransferableFormats.UrL_FOR... );
3: var dragImage:BitmapData = new Bitmat(dragButton.width, dragButton.height, true);
4: dragImage.draw(dragButton);
5: DragManger.doDrag(dragButton, transferForamt, dragImage);
ServiceMonitoring. Online / Offline monitor. It will alert you to changes to the network. Can detect if you have access to a service. This allows you to move from VPN to public and your applications can detect this. Then you know in your application if you can save to a service or to disk.
1: var request:URLRequest = new URLRequest(http://www.google.com);
2: request.method = "HEAD";
3: monitor = new URLMonitor(request);
4: monitor.addEventListener(StatusEvent.STATUS, handle_status);
5: monitor.start();
6: connectLabel.text = "Conencted: " + monitor.available;
DatabaseAPI: Fully embedded database engine. Using SQL Lite. You can create inline databases. You don’t have to access a remote service. Great for syncing data to your service. You can literally write local and then remote later to the exact same table.
1: connection = new SQLConnection();
2: var file:File = new File("app-storage:/queuedemo.db");
3: connection.open(file);
4: connection.addEventListender(SQLEvent.OPEN, initDB);
5:
6: var stmt:SQLStatement = new SQLStatement();
7: stmt.sqlConnection = connection;
8: stmt.text = "SELECT * from CONTACT";
9: //... went to fast ... dang.
10:
[1:47pm] Business Class AIR (salesforce.com)
The new speaker is from a company called salesforce to show us how they are using AIR. I get the impression this guys sells Database services and is plugging this as a solution for developers that do not have an IT shop. This is dragging on. Nothing about AIR. All about salesforce and how they manage a DB for you. They offer a FlexAPI to plug into their database service. Just download their swf. Now seeing some demos of their API. They even made up their own SQL language. They have a developer edition account that is free for developers. If you write an application using them, they will allow you to ’sell’ the application on their application exchange system.
[2:29pm] Yahoo! Development Demo with AIR
Media Innovation Group at Yahoo! Available as flash applications that you can put on your webpage, but now can be AIR desktop applications. MiniBar. This is a widget that is a summary of weather, stocks, headlines, and photos, search different places and get data in browser via yahoo. CUTE customize feature. The widget literally flipped like it was a sheet of paper. The ‘back’ allowed you to customize the application. Wide mode vs tall mode.. super wide flattens out completely. They have though a lot about what it means to be rich in their interface.
Next Demo is a Playlist Badge. Very nice ‘crushing’ feature. As you make the window smaller the application transforms itself into a usable app that fits the space. The menu on this app is 4 icons. you click on them and the app transforms to that menu. Very nice.
Now he is showing us how to take an existing HTML/JavaScript program and turning it into an AIR application. Same kind of stuff we have see in the morning.
looking at window.nativeWindow in JavaScript will tell you that you are in an AIR application. Then your old code can do ’special’ things if being launched as an AIR. This allows you to release both old school and AIR with one codebase. His example is talking about adding links to del.icio.us. Research that. You can see the example of old html/Javascript application to AIR here.
[2:48pm] Using Ajax Frameworks to build AIR applications
This speaker is from nitobi. Development company that specializes in rich Internet development (RIA). They provide components to ease development. Just finished a book called Enterprise Ajax which will be in stores on Tuesday July 25th, 2007. You can reuse your existing javascript libraries because they work in AIR seamlessly. Some usability items on why AIR. You can read and write files to the desktop. You can now give them the OS feel. You can now drag and drop from your desktop to the AIR application. Copy and paste is much richer than what you can do javascript where it’s not consistent across platforms. You can go offline now with AIR vs javascript web application. You can now access background processes in the OS. You can notify the users of items easier in AIR. You get keyboard shortcuts that are not limited to what the browser can handle or has not already taken.
Demo. Ajax Fisheye Menu. We are going to see how his existing FishEye application can be pulled into AIR. Cool application. Now he is showing how to use DreamWeaver to create an AIR application.
Demo. Offline Contact Manager .. happens to utilize salesforce API from earlier today. He is showing how the data he changes online at salesforce is reflected in his AIR application.
Demo. MultiVista … construction company. They take photos of construction as it goes on. It scans a directory for photos. It manipulates the images and uploads them to a server. Like what Shutterfly does. Handles mass image manipulation for the client.
[3:19pm] EffectiveUI Demo
This company is building an AIR application for Ebay. This talk will be about this application. Sean Christmann. Local to Denver. eBay San Dimas project. Bring the buying and selling experience to the desktop. Why do this? For eBay it is all about the ability to overhaul eBay and start from the ground up. They can address what it means to buy and sell. Caching the data locally and being able to get alerts without having to hit F5 over and over again. It’s all about being LIVE with your data! Why AIR. Ease of use and cross platform.
Demo. Seeing the new application. New flex 2.0 feel. Focused on the buying aspect. Search field, drops down and shows you suggestions and you can see you cached version. You can search and see info you don’t want. You get a list of keywords for your search. You can select them and have them excluded from your search results. You can shuffle photos of auction items. It’s fun but does not get in the way. You can see how the bids look graphically with a chart. You can pull up history on a user that is bidding easily. Now he bids… get’s outbid. Now he has a notification window that floats outside the application. These notifications can pop up if you get outbid too. That is a great reason for moving eBay to AIR. Add a NOTE or an ALERT to any auction. It tracks what they do in eBay and it shows up in myEBay section. All your traffic is cached locally so you can see them. You can specify how much of the Hard Drive you want to use up.
Development Techniques. Built on the Cairngorm Design Pattern. If you know Cairngorm, you can jump to different Cairngorm projects. Less code reviews because everyone knows the pattern so code always works the same way. All assets are externalized assets. When you are done, you can then skin it out again for a different color/look. String externalized for internationalization.
He now goes into the architecture of the new application. You start out with an application core. The core is a hidden window and is always invisible to user. Goes to cache to get data. Goes to the server to get results etc. It spawns windows based off the state of the application. Login Window. Main Application Window. Alerts. etc. IF you close the main window, the core is still running and getting the latest data. Maybe you want a mini mode window so you can see quick info. This model helps with memory management. You can have the core invisible application kill off the child stuff to clean up memory.
Ebay’s has all of their services as SOAP services. The requests to eBay is XML serialized for communication via AS3 objects. WriteObject and ReadObject will serialize AS3 classes so you don’t need to worry about caching to disk. Very easy. No need to be some other object. Using the ACCESS framework in Java to pull off the AS3 2 SOAP communications.
www.projectsandimas.com - private beta, invite only through the summer. Invite X number each week.
[4:04pm] Frog Design
This company is about designing interfaces. The speaker is going to talk about the different designs they do. A few of the websites this speaker runs are: www.theflexblog.com, www.gotoandlearn.com, www.theflashblog.com, www.thewpfblog.com, www.leebrimelow.com, www.contentpresenter.com All examples will be on the www.theflexblog.com website. Ha, Ha, this guy is funny. Tools this guy uses for AIR development. Photoshop CS3, Flash CS3, Flex Builder 3, Expression Web. AIR applications can be flash, flex or html. All of these technologies can create an AIR application.
Showing an image that will be the custom chrome. You then use Scale-9 slicing to cut out the chrome.
AIR exceeds performance of WPF. Better at custom chrome. Making chrome transparent is a 10% hit on performance. Don’t do it if you don’t need to.
Same web development optimizations for WebKit browser will effect AIR application as well.
Mostly visual demos .. the code goes by to quick. Wow this guy has come cool desktop applications. To much to say about what I have seen. Nothing code wise, just cool examples. I’m will have to checkout his website after the fact. This guy develops in Flash. Now he is going to talk about going from flash to AIR.
Inside Flex, imbed a flash.swf file. You can then access the flash code in flex. Flash CS3 AIRPanel is an unofficial way to move flash into AIR. AIRPanel is an AIR application that lets you visually create the AIR application.xml file. Since flash CS3 has no real way to access this application.xml file in the tool.
Now seeing a demo in Flash CS3. Creating an application and moving to AIR.
See demos at www.theflexblog.com after a few days.
Book: ActionScript3 animation by Keith Peters
[6:06pm] Late Night Session
They are plugging the 360 conference and the MAX conference in September.
[6:22pm] Deconstructing the Bus
The “Bus” for the AIR Bus tour, has some flex applications that tracks data for this tour. You can see these applications on the tour website. It shows where the bus actually is and where it has been as well as photos they take as they go. They have an application on the bus that takes a photo every minute, GeoTags it, and uploads it to flicker. This is implemented using wireless data card which gets them access to the Internet while on the bus. They steam the conferences over the web from the bus. They run the AIR applications AIRTracker and AIRSnapshot. Tracker saves the locations while the snapshot is sending the images to flicker.
AirTracker. We are seeing the app and the code. It has a live map that shows where you are. You can download from google code off the bus/api website for the tour. it uses GPSBabbel which can talk to GPS devices. The script fires via cron ever minute. The data is then passed into these AIR application. How do you capture those online arguments?
In onCreationComplete function, line 147.
1: // called when an app launches, called from
2: // the command line with arguments
3: // if first time or if it is running.
4: Shell.shell.addEventListender(InvokeEvent.INVOKE, onInvoke);
Flex has a logging framework. Logs can be sent to targets. you can send to a file, or a text area etc.
We are digging literally through this code base. Interesting points are how they queue items incase they are offline. The timestamp used when created the GeoPoint is off the client and not the server.
Highlights.
How to tell if you are online or offline. This focuses on what you need to connect to. If you can’t touch the server, it’s offline. So you can be online but not on the right network so this will think you are ‘offline’.
1: //GeoPointQueue.as
2: // Create a socket connection to URL on port 80 to see if you can talk there.
3: private function initMonitor():void {
4: monitor = new SocketMonitor(monitorAddress, 80);
5: monitor.addEventListender(StatusEvent.STATUS, onStatusChange);
6: monitor.pollInterval = MONITOR_INTERVAL;
7: monitor.start();
8: }
9:
10: if(monitor.available){
11: sendNextPoint();
12: }
13:
How to write ActionScript Objects to the filesystem. You can serialize an ActionScript class.
1: var storage:File = new File(QUEUE_STORAGE_PATH);
2: if(!storage.exists){
3: queue = new Array();
4: return;
5: }
6:
7: var fs:FileStream = new FileStream();
8: fs.open(storage, FileMode.READ);
9: queue = fs.readObject() as Array;
10: fs.close();
11:
12: var storage:File = new File(QUEUE_STORAGE_PATH);
13: var fs:FileSystem = new FileStream();
14: fs.open(storage, FileMode.WRITE);
15: fs.writeObject(queue);
16: fs.close()
What to look out for when saving data? This tells a class to be serialzable!
1: [RemoteClass(alias="come.adobe.onair.geo.GeoPoint")]
Brief comment on what to do if you get a conflict writing the same record. Skirted the issue saying, yea, that’s hard. Yep, it sure is.
AirChat. This was written on the bus and you can download the code too. You can basically chat with the guys on the bus. This is the flex/html application. It will bring in the live video feed on the bus too.
TwitterCamp. AIR application that lets people ask questions from anywhere in the world. You can get this of google code too. Search for twittercamp in google.
[7:26pm] On the Road
Well, the day has ended and it was a lot of fun. Despite my best efforts I was unable to win a copy of CS3 Master Suite during the question and answer.
Speak Geek
I learned some new terms at this conference that I have never heard before. Slurp these guys up and start throwing them around the office!
“Into the cloud” When talking about a service on the Internet, you making a request into the cloud.
“Chrome”: Your “chrome” is the OS interface that can house your AIR application.