Meet the Guru Courses

  • Flex 3 Meet the Guru Course with Marco Casario

My Books

  • Follow me on Twitter

Comtaste's Projects

  • Flex Solutions: Essential Tecniques for Flex 3 Developers - The Site
  • Comtaste, Flex 3, AIR and Java consulting
  • YouThru Multimedia Web Messaging
  • MobyMobile
  • UserMatter(s) Magazine
My Photo

Subscribe my blog

  • Get this widget from Widgetbox
  • Add to Google
  • RSS FEEDS
  • Enter your Email here to subscribe :



    Powered by FeedBlitz

How to create an in-memory database in AIR using ActionScript and JavaScript

One of my favourite AIR features is the support of creating local database file using SQLite embedded engine. If you have SQL skills it'll be easy to storing persistent local data  to your desktop application. You can use this feature to store application data, favourite users' configuration options, document-oriented application, to cache data and synch it with the network.
Creating a SQLite database in AIR is pretty simple:

1. Create a local file with the .db extension using the File class:

// JavaScript
var myDB = air.File.desktopDirectory.resolvePath("db/myDBFile.db");

// ActionScript
var folder:File= File.applicationStorageDirectory.resolvePath( "db" );                  
folder.createDirectory();            
_myDB     = folder.resolvePath( "myDBFile.db" );

2. Create an istance of the SQLConection class to open the database file to work with and open the database using the synchronous method open() or the asyncronous method openAsync():

//JavaScript

var dbConn = new air.SQLConnection();
dbConn.openAsync(myDB);

dbConn.addEventListener(air.SQLEvent.OPEN, onOpenHandler);
dbConn.addEventListener(air.SQLErrorEvent.ERROR, onErrorHandler);

// ActionScript

private var _dbConn:SQLConnection(); = new SQLConnection();

_dbConn.openAsync(_myDB);

_dbConn.addEventListener(SQLEvent.OPEN, openHandler);
_dbConn.addEventListener(SQLErrorEvent.ERROR, errorHandler);

If everything is ok the AIR SQLite database is created and opened. Now you're ready to create tables and populate it.
But a cool thing about the open() or the asyncronous method openAsync() is that you can create an in-memory database passing a null value to the first parameter of these methods. It means that the database is created not in a database file on disk but it's a temporary database reference.
The openAsync() method (as well as the opee())  has the following syntax:

public function openAsync(reference:Object = null, openMode:String = "create", responder:Responder = null, autoCompact:Boolean = false, pageSize:int = 1024):void

where the reference parameter is an Object that specifies the location of the database file that is opened. If you set it to null you'll create an in-memory database:

// actionScript

private var _dbConn:SQLConnection(); = new SQLConnection();

_dbConn.openAsync(null);


//JavaScript

var dbConn = new air.SQLConnection();
dbConn.openAsync(null);

So you can now create your SQL statements, define mechanism for executing multiple statements in a transaction, use  the begin(), commit(), and rollback() methods without having a local file. At the end of your operations you'll decide if storing the database on the local client or sending it to your remote server !

Using Flex 3 with BlazeDS and Java (JEE) training course released by Comtaste (London,Milan,New York)

Comtaste Training is proud to announce its new training course about Flex 3 development using BlazeDS. The course is the result of several enquiries made by our clients about those topics.
I've worked on the outline of the course and it's ready and I've just published it on the italian section of Comtaste's site (I'm working on the english outline for this training course):

Enterprise Flex Applications: Using Flex 3 with BlazeDS and Java (JEE)

The Flex 3 and BlazeDS course adds to Comtaste's course programs and it is the open source alternative to the Enterprise Flex Applications:Using LiveCycle Data Services and J2EE (Java EE) training course.

The Flex 3 with BlazeDS is a 3-consecutive-day lessons and we're scheduling it in the following three locations: London, Milan and New York City.

Enterprise Flex Applications: Using Flex 3 with BlazeDS and Java (JEE): Overview

BlazeDS is the open source technology released by Adobe and based on Java Remoting and web messaging. BlazeDS allows developers to easily connect to J2EE distribuite (Java Enterprise)architecture and to carry out real time data pushing to Rich Internet Applications created with Flex 3 or to desktop applications created with Adobe AIR. BlazeDS uses AMF format to transfer data in binary mode, a technique that increases the performance of the application compared to XML or SOAP formats. In this course we will illustrate the techniques to install, configure and connect Flex and AIR applications to BlazeDS in Java server logic, and how to exploit the characteristics of this technology.

Training objectives
The final laboratory of this course will allow participants to built complex and interactive Enterprise applications distributed in Java Enterprise JEE architectures.

Using the EncryptedLocalStore to encrypt data on the client with AIR

Another very important and delicate aspect of desktop applications, but not only, is the one regarding data encryption.
Encryption is the process of transforming data by using an algorithm to make it unreadable to anyone except those possessing a key.
Adobe AIR has an EncryptedLocalStore class that allows to encrypt data to store it on the client’s machine. Adobe AIR EncryptedLocalStore APIs use DPAPI (Data Protection Application Programming Interface) on Windows and the Keychain on Mac.
DPAPI  is a relatively easy-to-use cryptography API available as a standard component in Microsoft Windows operating systems. Keychainis a password management system in Mac OS X. The default keychain file is the login keychain, decrypted on login by the user's login password  stored in ~/Library/Keychains/.
Both the encrypted local store uses AES-CBC 128-bit encryption.
Using the methods of the EncryptedLocalStore APIs you can save and get data, stored as byte array data, in an encrypted format that cannot be deciphered by other applications or users. In fact each AIR application uses a different encrypted local store for each user.

The encrypted local data store has an maximum supported total capacity of 10MB.
In order to write data in an encrypted format, we use the setitem() methos that accepts the following three parameters, which it uses to set the items with a given name to the provided byte array data:

name:  a String that contains the name of the item in the encrypted local data store.
data:  a ByteArray  that contains the data 
stronglyBound:  is a Boolean with a default value set to false. When the value is set to true it prevents the possibility of hijacking your application 
To write information in an encrypted mode we can use the following setitem() method:

var str:String = "myPassword";
var dataEncrypted:ByteArray = new ByteArray();
dataEncrypted.writeUTFBytes(str);
EncryptedLocalStore.setItem("password", dataEncrypted);

and to read the encrypted information we use the following getitem() method:

var passwordBytes:ByteArray = EncryptedLocalStore.getItem("password");
var password:String = dataEncrypted.readUTFBytes(dataEncrypted.length);

In the next article I'll show you how to create an ActionScript class to use the EncryptedLocalStore in AIR applications.

Creating JavaScript functions within an ActionScript class in AIR

These days I'm working on the O'Reilly AIR Cookbook creating the examples for the chapter on the HTMLLoader class.
The HTMLLoader class has a powerful method that lets you to load html content from a simple html string. The method is part of the public methods of the HTMLLoader class: loadString().
It accepts a parameter that contains the html content to load within an istance of the HTMLLoader class.

With this simple code you'll load the htmlToLoad string into the HTMLLoader class. The _html istance will be rendered as HTML the content through the WebKit engine:

private var _html:HTMLLoader;
private var _htmlToLoad:String;

_html = new HTMLLoader();

_html.width = stage.stageWidth;
_html.height = stage.stageHeight;

_htmlToLoad:String =
'<html><body>' +
'<div id="content">Hello from JavaScript !</div>'+
'</body></html>    '

_html.loadString(_htmlToLoad);

The cool thing is that you can use this approach to write JavaScript objects, functions and properties as well as defining the HTML structure within an ActionScript class, and then access to the html DOM  via ActionScript code.

Consider these three  important considerations:
a) access to the DOM elements and JavaScript objects only after the page load event is dispatched. The page load event corresponds to the COMPLETE event dispatched by the HTMLLoader class. You can create an event listener for this event using the addEventListener() method:

_html.addEventListener(Event.COMPLETE, onComplete);

b) you can access to DOM elements using the window.document object and invoking the getElementById, and getElementsByTagNamer() methods. The window object represents the global JavaScript object for the content loaded into the HTML control.
c) you can edit and create the content of the html content using the innerText and innerHTML properties

In the next page I've created an example where an HTML content is created within an ActionScript class and then loaded into an HTMLLoader object. I've accessed using ActionScript to the HTML DOM to get the content within the DIV tag.

NOTE: Because of some formatting issues, this post was posted on my personal blog as well as Comtaste's blog. Sorry for that :)

Continue reading "Creating JavaScript functions within an ActionScript class in AIR" »

Creating JavaScript functions within an ActionScript class in AIR

These days I'm working on the <a
href="http://www.amazon.com/Adobe-AIR-Cookbook-Application-Developers/dp/0596522509">O'Reilly AIR Cookbook</a> creating the examples for the chapter on the HTMLLoader class.
The HTMLLoader class has a powerful method that lets you to load html content from a simple html string. The method is part of the public methods of the HTMLLoader class: loadString().
It accepts a parameter that contains the html content to load within an istance of the HTMLLoader class:

private var _html:HTMLLoader;
private var _htmlToLoad:String;

_html = new HTMLLoader();
htmlToLoad =
'<html>' +
'<body>' +
'<div id="content">Hello from JavaScript !</div>'+
'</body></html>';

_html.width = stage.stageWidth;
_html.height = stage.stageHeight;
_html.loadString(htmlToLoad);

With this simple code you'll load the htmlToLoad string into the HTMLLoader class. The _html istance will render as HTML the content through the WebKit engine.
The cool thing is that you can use this approach to write JavaScript objects, functions and properties as well as defining the HTML structure within an ActionScript class, and then access to the html DOM  via ActionScript code.

In the next page I've created an example where an HTML content is created within an ActionScript class and then loaded into an HTMLLoader object. I've accessed using ActionScript to the HTML DOM to get the content within the DIV tag.

Consider these three  important considerations:
a) access to the DOM elements and JavaScript objects only after the page load event is dispatched. The page load event corresponds to the COMPLETE event dispatched by the HTMLLoader class. You can create an event listener for this event using the addEventListener() method:

_html.addEventListener(Event.COMPLETE, onComplete);

b) you can access to DOM elements using the window.document object and invoking the getElementById, and getElementsByTagNamer() methods. The window object represents the global JavaScript object for the content loaded into the HTML control.
c) you can edit and create the content of the html content using the innerText and innerHTML properties

Because of some formatting issues I had on our company's blog, to speed it up I've duplicated this post on both blogs (personal and company). Sorry for that :)
You can see the complete ActionScript 3 class on my personal  blog (next page).

Continue reading "Creating JavaScript functions within an ActionScript class in AIR" »

Migrating from AIR 1.0 to 1.1 and Flex SDK 3.0.2

Yesterday the AIR 1.1 was released by Adobe.  AIR 1.1 is a small release that introduces  international support to  applications.
From a development point of view if you're suing Flex 3 to create the AIR application you need to take some manual steps in order to include     support for AIR 1.1.

You nedd to download the 3.0.2 build from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3     and install it by unzipping it to a location of your choice.

Adobe has cool articles to read about this new AIR 1.1 release you should read:

AIR Cookbook site launched. Call for entries

The AIR Cookbook was on Amazon last week and now the project was officially announced by Adobe.  I'm pretty excited for this book because, first of all, it is my first book for O'Reilly and then we got a great group of authors: David Tucker, Rich Tretola, and Koen De Weggheleire as well as myself.
Today Adobe has launched the AIR Cookbook site. Like the Flex Cookbook you can use the AIR cookbook to share knowledge and find answers to common coding problems.
If you're new to the AIR cookbook and would like to contribute:

  1. Read the FAQ and note the community and editorial guidelines and known issues.
  2. Search the cookbook to avoid posting redundant recipes.
  3. Post your solution to the cookbook:

    • Choose a succinct, descriptive title for the problem.
    • Provide a brief summary statement of the solution.
    • Write a detailed description of the solution.
    • Include downloadable samples (optional).

Needed Entries

If you have a solution related to the following or any other topic related to building on AIR:

  • Bridging content from different security sandboxes
  • Using transactions with queries
  • Including a database in an AIR application
  • Consuming eBay Web Services
  • Reading and writing data from a file
  • Making creative use of the Service Monitor Framework

—be sure to post it to the AIR cookbook for a chance to have your solution appear in the upcoming Adobe AIR Cookbook written and compiled by David Tucker, Marco Casario, Rich Tretola, and Koen De Weggheleire to be published by O’Reilly Media. All posts will receive equal consideration.

Pre-Order the Book

If you really, really, want to get your copy ordered early - Amazon already has the book listed (but remember - the book will be out late this year).

AIR Cookbook

Adobe AIR Administrators Guide

Adobe has created a new section on the Adobe AIR support page oriented to IT administrators.
On this page you'll find the  "Adobe           AIR Administrators Guide" (PDF) that provides details on how to deploy Adobe           AIR in enterprises and tuning of other runtime settings, and other reference documentations for the enterprise scenarios.

O'Reilly AIR Cookbook on Amazon

I've just finished working on the Advanced AIR Applications book for  FriendsOfED, that a new book project started. I'm now involved in writing the O'Reilly AIR Cookbook, accepting the invitation made by David Tucker. The other authors are talented Flex and AIR developers with a lot of writing experiences: Rich Tretola, Koen De Weggheleire and David Tucker.

This is my first book for O'Reilly and I'm glad to work with you guys !

Caching data locally to work offline in AIR applications

These days here in Comtaste, I'm very busy for a consulting activity to support a project for an Adobe's Italy partner (I'm under NDA so I can't do names), working on a enterprise desktop AIR application (that uses Java, Oracle Form and Hibernate). The project is a porting of an ActionScript 3/J2EE web application, so what we're doing is to write ActionScript 3 classes to add AIR desktop functionalities.

A sad note. This project is the reason why I won't be able to come to the onAIR tour in Milan :( damn !

We're spending a lot of time defining the state of the application when it goes offline. In fact the AIR project will work in online as well as offline mode (it's what Adbe calls Occasionally Connected Application).
The application must provide most of the functionalities when it's on offline status: reading and writing data, loading assets, saving data etc.
Actually AIR comes with a lot of APIs to reach these goals: the service monitor framework, the SQLite support, the I/O classes and more.

What we're developing is a series of ActionScript 3 classes to synch a database from local to remote using SQLite (local) and Oracle (remote) and a system that checks and monitors the network connectivity to cache external assets from the web server to the local client.

I can't post the code we're working on, but I want to share some simple and effective tips for caching assets when the AIR application goes offline.
The AIR SDK provides the service monitor framework APIs that consti of the ServiceMonitor class plus two subclasses: URLMonitor and SocketMonitor.
The service monitor framework is not included in the standard AIR SDK so if you're using Flash or AJAX you have to import the libraries into your package. If you are using Flex Builder 3 the IDE will embed the framework automatically.
You can read a lot about this framework on the AIR documentation.
The service monitor framework allows developers to test and monitor HTTP based service using the URLMonitor subclass. The usage is pretty simple. You specify two parameters in the constructor of the class: the URLRequest object and the
Invoking the start() method of the URLMonitor class a listener will be created and will check and monitor the URL specified for the netire life of the application. If the status of the netwrok connectivity will change,  the STATUS event will be raised.

So we can use this event accord ???? to get the status of the connection through the available property of the URLMonitor class.

import air.net.URLMonitor;

import flash.events.StatusEvent;
import flash.net.URLRequest;

monitor = new URLMonitor(urlRequest);

monitor.start();

monitor.addEventListener( StatusEvent.STATUS, onStatusEvent );

private function onStatusEvent( event:StatusEvent ) : void
{      

if (monitor.available)
{

// You're connected
// Load your assets from your remote server

} else
{

// You're not connected
// Open the assets locally
// Change the state of the application to offline status

}

}

Once we get the status of our connection and getting notified by any network connectivity change, we can write the methods to save and read the assets locally.

Continue reading "Caching data locally to work offline in AIR applications" »

RoboHelp Packager for Adobe AIR

If you create help system, knoledge base RoboHelp is the tool you're using.
Now Adobe has released the RoboHelp Packager for Adobe AIR on Adobe Labs. You can download th package and start exporting your assets for the desktop with AIR.
Adobe has created three sample AIR  files to experience the look and feel of Help delivered via Adobe AIR:             

With RoboHelp Packager for Adobe AIR, you can package the complete project in a single distributable file - including TOC, Index and Glossary along with content files.  Unlike RoboSourceControl, reviewers don't need RoboHelp to review the content and unlike PDF, the help files maintain the same look and feel in Adobe AIR.   Readh the full entry: Sending your RoboHelp Project for Review - use Adobe AIR

       

With RoboHelp Packager for Adobe AIR can:

       
  • Generate a single distributable file similar to a .chm file.
  • Provide a variety of skins from which a user can choose from. In addition, for any skin a user can choose different themes, which control the look and feel in terms of colors and button/icons images.
  • Provide a consistent look and feel on all platforms and operating systems.
  • Enable you to comment, in addition to using other advanced features such as Breadcrumbs, Mini TOC and Security (Digital Signatures).
      

Flex, Livecycle Data Services, BlazeDS and AIR development for the Enterprises

For Adobe Italy Comtaste has created a series of  free events where we'll talk about the use of Flex, Livecycle Data Services, BlazeDS and AIR development in enterprises contexts.

The first event will be in Rome on June 18 : AIR development for Enterprise desktop applications

We'll show how to create desktop applications using AIR and how to integrate them to JEE enviroments with  LiveCycle Data Service and BlazeDS.

The second event was scheduled in Rome on July 2 and Milan on June 25. The tile of the event is  Enterprise Flex Application with  LiveCycle Data Services.

The events are totally free but you need to register on the Adobe Events site.

Do I need to sign a redistribution license to deploy AIR in an enterprise setting ?

At least someone has given a clear answer to the  question about the redistribution license of AIR application in an enterprise setting from a centralized server. Oliver Goldman wrote a clear post talking about the AIR's enterprise support where he pointed out what you can  do in AIR 1.0:

  • You can deploy AIR and AIR-based applications via enterprise deployment tools like Microsoft SMS and IBM Tivoli,
  • You can disable auto-update of both AIR and AIR-based applications, and
  • You can configure which applications, if any, AIR will permit to be installed.

So the end of the story is that if you're not using the Adobe's download servers fr deploying AIR applications but  your enterprise AIR  is deploying  from an internal server (IBM Tivoli, Microsoft SMS)  that means that you're redistributing  it.

Have also a look at the AIR Runtime Distribution FAQ.

Disable the auto-update capability in Adobe AIR using the SettingManager application

If you want to update the Adobe AIR runtime manually you have to disable the  auto-update capability. Using the AIR SettingsManager you can disable it.
AIR SettingsManager is a small application that use a toggle button to Enable or Disable auto-updates as desired.

Download AIR SettingsManager application.

Considering the byte order mark (UTF-BOM) when reading a text file using the readUTF() method in AIR

Working with Adobe AIR's d ead and write methods, we encountered  some strange behaviors when using the readUTF() method to read text files (TXT or RTF).
In fact if the text file we're opening has not been created by Adobe AIR,  we got a runtime error (number #2030 line ending ....) from the Flash Player. Investigating we discovered that the readUTF() method won't find a couple of bytes embedded into the file that it needs.

From the Adobe AIR  documentation :

The readUTF() and the writeUTF() methods (not to be confused with readUTFBytes() and writeUTFBytes()) also read and write the text data to a file, but they assume that the text data is preceded by data specifying the length of the text data, which is not a common practice in standard text files.

Some UTF-encoded text files begin with a "UTF-BOM" (byte order mark) character that defines the endianness as well as the encoding format (such as UTF-16 or UTF-32).

Instead, reading the file using the writeUTFBytes() everything works well.
I'm trying to understand if the IDataInput and IDataOutput objects are responsible for the serialization/deserialization.

Anyone had the same problem ?

Continue reading "Considering the byte order mark (UTF-BOM) when reading a text file using the readUTF() method in AIR" »

Download the free Adobe AIR 1 for JavaScript Developer pocket guide

Airbookcover The Adobe AIR 1 for JavaScript Developer pockek guide has been updated to Adobe AIR 1.0 and it's ready to donwload.

It contains details on how to access the exposed APIs, how the security model works and the Mini-Cookbook section gives you a good idea on how to start the development under AIR.

You can download (it is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License) from the AJAXIAN.com site (PDF format).

AdobeTechConnection Workshop: Flash Media Server 3, Flex 3 and AIR

15042008779 Adobe Italy and Comtaste has organized, with the support of FlexGala, the first  of a long series of workshop dedicated to  Rich Internet Application development. This kind of event is a totally free real training session. In fact we've requested to all partecipants to bring their laptops to follow the day.
In this first meeting we've talked about Flash Media Server 3, Adobe AIR and Flex 3.  Matteo and I have taken examples and demos we usually use for Comtaste's training courses about these topics.
People were very interested and we gave the basics to stream a video content using the Flash Media Server 3 and ActionScript 3 (with Flash CS3 as well as Flex Builder 3).
15042008774_2 In the second part of the morning we showed how to export the streaming video on AIR using flash CS3 and Aptana.
Adobe Italy has supported the event offering the possibility to make a raffle for donating a Flip Video Ultra device (it's so coool !).

You'll find all the slides and demo example on FlexGala Adobe user group site.

Spending two days teaching AIR and Flex 3 for Adobe Italy's Partner

These days I'm teaching my first Adobe AIR 1 training course at Adobe Italy's headquarter. This is a 2 days course offered by Adobe Italy to some Adobe's Partner. I'll repeat the same course on 16th and 17th April due to the high number of requests. It has been a big success !

I'm having great time with attendees that are all skilled developers (.NEt and PHP mainly) and very interesting in the Flex 3 SDK and AIR development. Tomorrow I'll show the RPC classes of Flex 3 and how to consume Web Services through an AIR application.

Flex 3 and AIR are two of the most impressive technologies in terms of features and easiness of use.

Adobe AIR Guide updated against AIR 1.0 on FlexGala user group site

Flexgala_100x50 FlexGala, the italian Flex User Group, has just updated all the articles of the Adobe AIR Guide against the final release of Adobe AIR 1.0 recently released (thanks to Fabio for this).
The Adobe AIR Guide is made up of 17 AIR lessons (in italian language) that introduce the developer to the use of AIR features and ActionScript APIs to create desktop applications.

These are the lessons of the Adobe AIR Guide :

Adobe AIR for Linux available on Labs

That's a great news. Adobe AIR 1 for Linux has been released by Adobe today. If you visit the Labs you'll find it :

The Adobe AIR for Linux alpha is a version of the Adobe AIR runtime that allows Adobe AIR applications to be deployed on computers and devices running the Linux operating system. In addition, Adobe Flex Builder for Linux can be used to build rich internet applications that deploy to the desktop and run across operating systems using proven web technologies.

So we can now test our AIR applications on Linux  but unfortunately at this stage the Adobe AIR for Linux alpha is not feature complete yet.

Adobe AIR 7 Day Sprint - Day 1

Sprint_220px It was an idea proposed by Ryan some months ago so I've decided to dedicate my spare time (do I have spare time?) to make 7 posts in which I take 7 days to learn Adobe AIR 1 (the next one will be on Adobe Flex 3).
My plan is to talk about the resources, the problems and the solutions I'll find simulating the issues a new AIR developer will face with. I'll take advantage of some notes I've collected during my last Adobe AIR Crash course I held for an italian company.

Adobe AIR  7 Day Sprint - Day 1

Before starting with the development, we have to set the machine up. One of the cool aspect of Adobe AIR is that it lets developers use proven web technologies to build desktop applications and run across operating systems. So it does not matter if you're a Flex, Flash, or AJAX developers. You don't have to learn a new language or a new IDE to develop AIR applications.

Use your existing code in Adobe Dreamweaver CS3, Flex Builder, Aptana, Eclipse, Flash CS3 and your favourite  frameworks (dojo, spry, prototype, scriptacolous, cairngorm, PureMVC, Degrafa, etc) to deliver applications to the desktop that complement and expand your browser applications.

The first step is to download the free Adobe AIR runtime. The runtime is available for Windows and Mac OS system (read the requirements) and it will soon be available for Linux system too. The runtime is only available in english language.

Just in case you're wondering, the Adobe AIR Runtime is available for distribution and use beyond single-user installations. This means that if you'll use the web distribution or you'll use the runtime as individual users you won't need to sign an Adobe AIR Runtime Distribution License Agreement. Instead, if you are an OEM or PC manufacturer and would like to bundle the Adobe AIR Runtime with your computers, contact Adobe and read the FAQ about Adobe AIR Runtime distribution.

The next step is to download the software, SDKs, extensions, and frameworks you need to build, package, and deploy Adobe AIR applications according to your development environment:

Adobe AIR SDK:  the Adobe AIR SDK provides the tools you need to package and deploy Adobe AIR applications, if you prefer working with a text editor or another development environment.

Flex 3 SDK: the Free Adobe Flex® 3 SDK has all you need to build and deploy browser- or desktop-based applications that can run on Adobe Flash Player or Adobe AIR (includes the tools from the Adobe AIR SDK).

Flex Builder 3: develop RIAs with Adobe Flex Builder™ 3 software, an Eclipse™ based IDE (includes the Flex 3 SDK and the tools from the Adobe AIR SDK).

Adobe AIR extension for Dreamweaver CS3:  Package and preview Adobe AIR application files from within Adobe Dreamweaver® CS3 software.

Adobe AIR update for Flash CS3 Professional: Package and preview AIR application files from within Adobe Flash CS3 Professional software.

AIR plug-in for Aptana: Aptana is available both as a standalone application and as an Eclipse plug-in. You can add AIR support to your Aptana or Eclipse IDE by installing the AIR plug-in.

Continue reading "Adobe AIR 7 Day Sprint - Day 1" »

Flex 3 and AIR courses updated

We've just updated our Flex 3 and AIR courses on Comtaste's course catalogue :

The first course, Flex 3 and Flex Builder 3: Developing Rich Internet Applications with the new Flex 3 SDKs,  guides students in a step-by-step learning process that begins from the basic notions of Flex3 and Flex Builder 3 to the development of complex front end applications that communicate with remote data sources.
The second one, Developing desktop applications with Adobe AIR, Ajax and Flex,  introduces the participants to the development of Rich Applications with Adobe AIR using its capacity of being able to access the File System, to modify the Windows of the system, to function even in offline mode and to use the notification mechanism of the operative system.

Comtaste is a company focused in RIA development with Flex, Java, PHP and AIR. Our trainers are first of all experienced developers involved in several enterprise projects. Moreover they are very communicative instructors that can give students the right balance between theory and real world examples and contexts.
That's why many companies in the last months chose Comtaste as their training and consulting partner.

Back from the FITC. Hot impressions and feedbacks

Fitc125x125 The FITC is over and I'm back to my work in my Rome office. They were 3 fantastic days very  intensive where I had the opportunity to meet some old friends and new ones.

Carlos‘ and Ralph’s sessions were very inspiring to me and they showed a lot of cool things and ideas (ehi Ralph you've missed my session so you have to owe me a beer next time ;)).
Data Visualization with Flex and AIR by Nico Lierman was great and I loved the Google Analitycs examples  he showed us.

Aral' session was very original, as usual, and it was very fun to see the small pig pet flying in the room during the session :)
Unfortunately I've missed the Peter's and Koen's session but I met a lot of people that partecipated and they told they made an excellent job. Ehi friends it was a pleasure to spend all the time with you !

26022008453 My talk was titled Flex Solutions for your daily development and my plan was to give some quick and useful tips and tecniques to use for your Flex development. The crowd seemed very Flash-oriented so I hope it was interesting for all the audience.

The agenda of my talk was very busy and it was not easy to cover all these topics in one hours (in fact my session was 15 min lates ;)) :

How to architecture Flex application
Use the open source library
How to optimize the use of RPC class with the AsynchToken
Trace Network traffic
Debug applications using the Logging APIs
Flex Builder IDE Optimizations
How to overcome the cross domain policy
Using the Proxy Service of BlazeDS
Focus on Flex 3 new features: the new Collection classes and the AdvancedDataGrid
Flex Inspirational Quotes

In the late evening I'll publish the slides and the source code of my talk at FITC.

Using the J2EE View Helper pattern in your AIR applications

Having to do with many presentations, conferences and prototypes for clients, I'm creating many small applications using AIR and Flex 3. Most of them are prototypes with the purposes of showing AIR features and the quantity of code is small (600 lines at most).

In this context it does not make much sense to use a framework or architecture such as Cairngorm or PureMVC or Defraga. So that I'm using a lot what in JSP is called the View Helper pattern.

The view components of your  AIR and Flex   applications, that will only contain the controls that define the user interface of the application,  will use a simple View Helper, consisting in an ActionScript class, to encapsulate business logic in a helper instead of a view, making our application more modular by facilitating component re-use.

A view contains formatting code, delegating its processing responsibilities to its helper classes, implemented as an Actionscript class. Helpers also store the view's intermediate data model and serve as business data adapters.

View  helpers has the following advantages:

  • improve the separation between the presentation and the business data actinga as intermediaries between the two
  • most of the code contained in a view components is merely mxml code
  • the code within the view components are more readable and a designer can browse and edit it to change the visual aspects of the application in an easy way
  • it can cache lookup tables for the application

To invoke a view helper you can simply

<h:UploadHelper id="uploadHelper" xmlns:h="com.comtaste.proto.controls.*" />

and the view helper UploadHelper class is an ActionScript class where you'll  encapsulate the business logic of view component :

package com.casario.proto.controls
{
import flash.events.Event;
import flash.events.IOErrorEvent;
import mx.controls.Alert;

public class MainHelper
{

protected var URLString:URLRequest = new URLRequest("http://www.domain.com/file.jsp");

[Bindable]
private var statusStr:String = new String("");


public function MainHelper()
{
super();

}


}
}

For those who will attend my FITC session  (Flex Solutions For Your Daily Development) of the next week I'll show some examples of the View Helper pattern in Flex development.

If you want to have more details and ivestigate on this pattern you can visit the View Helper  Design Pattern of J2EE.

on AIR European Tour:learn everything you need to start building applications for Adobe AIR using Flash, Flex, JavaScript and HTML

Onair_logo_europe The onAIR Europe Tour has been scheduled at least !Eleven european cities will be touched by the tour that is a free full day event where you can learn everything you need to know to start building applications for Adobe AIR using Flash, Flex, JavaScript and HTML.
The team of the tour will be armed of a backpack, and will ride the trains across the continent to get to all of the cities. Good luck guys ! ;)

The italian date has been scheduled on 13th June in Milan.  You can't miss it. We'll be there !

So, who is the event targeted at? Basically, anyone doing web development, which includes Flash, Flex, HTML, JavaScript, PHP, ColdFusion, etc… If you are deploying web applications to the browser, and are interested in allowing those applications to also take advantage of the desktop, then this event will be useful for you. There are both Flash / Flex and HTML / JavaScript focused sessions, with the rest of the sessions relevant to both Flash and JavaScript based development. Unless otherwise noted on the schedules, the sessions are presented in English.

Speaking at the Adobe Tech Connection event

Adobe Italy and FlexGala has organized a full day event called :

Adobe Tech Connection
Using the Web 3.0 tools: Flash Media Server 3 and Flex 3/AIR

I'll be there to present some real world case stuides we developed at Comtaste and to show some Flex 3 and AIR tecniques that use audio and video streaming with Flash Media Server 3.
The event is totally free but it requires you to register from the Adobe site.
The location chosen is the Adobe Italy headquarter in Milan.

See you there guys !

Continue reading "Speaking at the Adobe Tech Connection event " »

My FITC schedule

Two weeks in advance of its European debut, FITC has sold out  its event in Amsterdam. FITC Amsterdam is scheduled for February 25 + February 26, 2008 at the Felix Meritis European Centre for Arts and Sciences. This is the first time that FITC, now in its seventh year, has ventured outside North America.
After reading at Peter's blog I decided to share my agenda for the event. I'll be there as speaker but I don't want to miss any of the sessions available.
It was very hard to choose which session to attend but this could be my final schedule :

Monday February 25th

Adobe Keynote - Mike Downey
RIA meets Desktop - Peter Elst
Data Visualization with Flex and AIR - Nicolas Lierman or Interactive Experiences with Papervision3D
ActionScript 4?? - Colin Moock
Kaboom!!! Flash Pyrotechnics - Seb Lee-Delisle
Building Red5 Applications - Chris Allen
New Works - Joshau Davis

Tuesday February 26th

Play with Pixels - Koen De Weggheleire
The Circle - Jared Tarbell or AIR Conditioning - Lee Brimelow
Making real music within Flash - Andre Michelle
Building AIR applications with Flash CS3 - Mike Downey
Flash 2D & 3D effects - Ralph Hauwert
Flash now and in the future - Serge Jespers
Flex Solutions for your daily development - Marco Casario it's mandatory for me to be there !

Write a file using the Date() object as filename in AIR

During an AIR training session I held in a company who wanted to evaluate the technology for some of their projects, some developers asked me how to save a file programmatically using a different name each time the file is saved.

My first reply was to use the Date object in order to create a unique string to use as file name. So the code would be something like that :

file = File.documentsDirectory.resolvePath("snapshot" + new Date().time.toString()  + ".jpg");

or, a second possibility is to use the DateFormatter class with the format() method to format a Date object and get back a String    containing the new, formatted, value :

var file:File = File.createTempDirectory().resolvePath(("snapshot" + dateFormatter.format(new Date())+".jpg");

Any other tecniques to use ?

Advanced AIR Applications, the book

It's now official and I can talk about this new project. I'm involved, together with other great authors such as Koen De Weggheleire, Peter Elst, and Zach Stepek, in writing the AdvancED AIR Applications.
This book is intended for advanced AIR developers who have learned the basics and want to take their skills a step further.

I've prepared a lot of cool examples for showing some advanced tecniques in AIR development. Some of the applications I've prepared for the book deal with :

Advanced File management
Serialize/Deserialize objects
Developing a Contact Management Application
Creating a Flickr AIR Application
Using Cairngorm for AIR Application development
Developing a media desktop reader integrating YouTube FLVs

I've read the TOC of the AdvancED AIR Applications and other authors are preparing awesome AIR applications for this book !


Continue reading "Advanced AIR Applications, the book" »

AIR and Flex beta 3 docs:choose the right one

I just wanted to point it out. Randy Nielsen, Adobe Flex Doc Team, wrote a comment on my post about Flex 3 Beta 3 documentation is not updated to AIR Beta 3 ?. My thought was to give more visibility to that comment because it's good to know for everyone:

For Beta 3, there are duplicate copies of the AIR-Flex docs. The docs under http://livedocs.adobe.com/labs/flex3/html/Part5_AIR_1.html are about two weeks older than those under http://livedocs.adobe.com/labs/air/1/devappsflex/index.html. When the final version is released, there will only be one copy on LiveDocs and it will be up-to-date.

AIR 1 will be released next month according to Computerworld

Reading this article publised today by ComputerWorld, Adobe is expected to release its Adobe Integrated Runtime (AIR) next month, ending the wait of organizations such as Nasdaq Stock Market Inc. and American Cancer Society Inc. for a way to tap the best attributes of a browser but without the browser -- to take some of their rich Internet applications to the desktop.
The article worths a reading and as Mike Downey said : "You don't have to be a C++ programmer to build a desktop application any more, using AIR should be a fairly transparent experience for anyone already doing AJAX development."

Go ahead Adobe ! (thanks to Jeffry Houser for his news on Twitter :) )

A report from the Flex 3 and AIR Pre-release tour with James Ward

23012008227_6 Yesterday we had James Ward here in Italy presenting at the Flex 3 and AIR Prerelease tour. It was an awesome day spent with James and I had a lot of funny and he showed us a lot of cool demos ! Now I understand much more about BlazeDS and Thermo ! And they are great. We can use RemoteObject with AMF3 for free, without requiring us to buy the Livecycle Data Services license (you need it if you want cool features like Data Management services and other stuff).

The crew that partecipated at the event, came from different development enviroments.There were many Java developers (I extended invitations to the Java Community), PHP Developers as well as Coldfusion developers.23012008240
This event was one of the best of the last months organized by Adobe. The location was great, large enough to host more than 100 people. The speaker was awesome (thanks again James) and people were incredibly passionate. It's not so common to see people involved in vertical and developer-oriented technologies like BlazeDS, Livecycle DS and Flex. James received a lot of good and interesting questions that you can read  at the bottom of this report.

We made a cool raffle at the end of the event and we gave a lot of prices : Flex Builder 3 and CS3 Web Premium licenses (thanks to James), books gently offered by O'Reilly and FriendsofED (thanks to FlexGala User Group), Adobe t-shirts, bags, mugs and other gadgets (thanks to Francesca for bringing'em).

It was a great success.
Thanks Sumi, James, Francesca, Adobe and all guys from the community members.

Continue reading "A report from the Flex 3 and AIR Pre-release tour with James Ward" »

Adobe AIR upcoming books by FriendsOfED, Wrox and other publishers

FriendsOfED has published two new books on Adobe AIR. The first is the  Foundation AIR: Creating Desktop Applications with the Adobe Integrated Runtime.
This book covers the basics of the AIR technology and the author, Zach Stepek, said that the book :

    * Cover the essentials of this revolutionary new technology
    * Learn how to best take advantage of AIR’s features
    * Create desktop applications that leverage the Internet

The second book is more vertical and talks about the integration of AIR with web services. The title is : Creating Mashups with Adobe Flex and AIR and it look like very interesting :

    * Create unique mashups from technologies such as Flickr and Google Maps
    * Style your applications using Flex 3
    * Create desktop applications that leverage data from the Internet

Then I've also found a book by Rich Tretola Beginning AIR: Building Applications for the Adobe Integrated Runtime  and AIR Instant Results book by Wrox and many more AIR books on Amazon website.
More documentation you have on a technology more is the interest around that about the
Said that I'm pretty sure we'll soon see many others books about AIR.

Adobe AIR article on the most popular italian newspaper

Corriereair_2 The most populare and read italian newspaper, Corriere della Sera, has published an article about Adobe AIR technology. It's not so often that a newspaper in Italy talks about an emerging technology so it's a very positive aspect.

The article is in italian, but the translation of the title is something like : Adobe AIR beyond the Web 2.0 (thanks to Gianfranco to point it out)

A great way to begin the new year ;)

Find enchanting locations in Italy with a brand new RIA : YuBuk

I'm glad to announce a new project's on which Comtaste is working on : YuBuk. Flex with cross scripting techniques,  Google MAPS, AJAX with Scriptacolous and Prototype libraries are some of the technologies involved in this project.
It was very fun to see how a simple web based old style application in some months turned into a real rich internet application.

We have published a Case Study on our site, where you can have more details.

Yubuk Yubuk is  a platform which is accessible on the internet and on mobile terminals for all those who love Italy for its enchanting locations, for its excellent cuisine and exceptional hotels.
Yubuk.com contains information on ten of the “coolest” locations in Italy, information which is accessible to all and to which all the users can contribute and create, modify or comment.

This is one of the best and most useful mash up Rich Internet Application we've worked on. In fact to be able to conceive new and richer modes of fruition, the technological choice has also required a careful analysis of the languages and the standards of highest profile.

Starting from the initial prerequisites, at Comtaste we have analyzed the following list of technologies was opted for which together has contributed to create a true and real mash-up application:

  • AJAX with Scriptacolous and Prototype libraries
  • Flex with cross scripting techniques
  • Google MAPS
  • PHP
  • Zend Framework
  • MySql

It was chosen to use Google Maps to visualize, through the use of its API, the restaurants, hotels and all the locations present in the data bank of Ybuk.com.  Furthermore, Ajax and Javascript functions were adopted to reduce the minimum traffic of data and download only the data relative to the portion of map visualized by the user. Through the use of the combination of Flex and Javascript technologies additional filters were made available to the user to optimize the searches on the map.  

The increase of the visits to the site has brought (and will continue to bring more) an increase of traffic and load on the infrastructure web server. To avoid problems of instability or delays on the site, it was decided to separate the principle applications of the site on two different servers, Apache and PHP 5 was installed on the first, and instead MySOL is present on the second. Both applications were configured in order to obtain the best performance in relation to the load.

To improve the entire infrastructure of the site, a course or restructuring of the code was undertaken to exploit the potential offered by a powerful and famous PHP framework such as Zend. Security, reliability, modulation and integration are just some of the benefits that such a choice entails. The Zend Framework uses the latest development technology to be able to produce flexible and extendible code, using the standard design pattern for the web applications, the model-view-controller (MVC). Furthermore, in the framework, there are also functions present among which internationalization and localization, authentication, session management, search, cache and integration with external APIs.

The activities on Yubuk are up and running, with a continuous assistance for the improvement and evolution of the service. Important goals have already been achieved, measurable especially in terms of the improvement of the user experience and the ranking of the portal.

Developing with Adobe AIR and Microsoft Silverlight Crash Course

I've just found this interesting track at the Web Directions conference that this year has some  Rich Internet Application tracks :

Developing with Adobe AIR and Microsoft Silverlight

Web Directions
focusses on practical and inspiring concepts, technologies and techniques for people whose day to day job is building web sites, applications and services. It’s for web designers, front and back end developers, product managers, Information Architects, and anyone else responsible for building great web solutions

Continue reading "Developing with Adobe AIR and Microsoft Silverlight Crash Course" »

Adobe AIR Job Trends

I was wondering what the job trends for Adobe AIR developers was. It's fun to see how much time the word "Adobe AIR" appears in job postings around the globe. The following graph shows this trend from which you can understand how the AIR Developer job position will grow in the next future :