Started with Adobe AIR


Adobe AIR (Adobe Integrated Runtime) is a framework for creating Development desktop applications, one level above in relation to the Rich Internet Application (RIA) that already exist. Being able to create an interactivity never before seen in relation to desktop applications and web.
Large companies already use it in full swing since he was still in beta as an example:

Who can develop on Adobe AIR?
The Adobe AIR logo is a sample of this, basing his design on a boomerang, each tip meaning that the developer has the option of programming with Adobe Flash, Adobe Flex and html/ajax:

Alguns recursos disponivéis com Adobe AIR:

  • Any Flash Player API and a exclusive API for javascript;
  • API update automatically;
  • Automatic installation API;
  • support the file system;
  • an application that run on both Windows, Mac or Linux;
  • Use of digital certificate;
  • multidiomas support (from version 1.1);
  • HTML engine based on webkit (the same used in Safari, nokia, google chrome, etc.);

Some features are not available:

  • Execution of external programs;

A first example
Show an example that Ben Forta always likes to demonstrate in his lectures 🙂
But before, we know about the structure of an application made in Adobe AIR:
In this example I will use the Adobe Flex Buider 3
In the menu “File-> New-> Flex Project” to create a new project.
In the next window is where we determine whether the project will be for the web (with Flex) or desktop (Adobe AIR), select the Adobe AIR.Nas other screens, just click next and finish. Will be created a directory structure like the image below:
Note that besides the file. Mxml created by default, was also created a file-app.xml, and in mxml a new tag, a WindowedApplication.
In the file-app.xml costam general settings of your application such as: name, version, description, directory where it will be installed, transparent window, icons etc.
follows the complete source code mybrowser-app.xml

  1. < ?xml version="1.0" encoding="UTF-8"?>
  2. <application xmlns="http://ns.adobe.com/air/application/1.1">
  3.  
  4. <!-- Adobe AIR Application Descriptor File Template.
  5.  
  6.     Specifies parameters for identifying, installing, and launching AIR applications.
  7.  
  8.     xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/1.1
  9.             The last segment of the namespace specifies the version
  10.             of the AIR runtime required for this application to run.
  11.            
  12.     minimumPatchLevel - The minimum patch level of the AIR runtime required to run
  13.             the application. Optional.
  14. -->
  15.  
  16.     <!-- The application identifier string, unique to this application. Required. -->
  17.     <id>mybrowser</id>
  18.  
  19.     <!-- Used as the filename for the application. Required. -->
  20.     <filename>mybrowser</filename>
  21.  
  22.     <!-- The name that is displayed in the AIR application installer.
  23.          May have multiple values for each language. See samples or xsd schema file. Optional.
  24.  
  25. -->
  26.     <name>mybrowser</name>
  27.  
  28.     <!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. -->
  29.     <version>v1</version>
  30.  
  31.     <!-- Description, displayed in the AIR application installer.
  32.          May have multiple values for each language. See samples or xsd schema file. Optional.
  33.  
  34. -->
  35.     <!-- <description> -->
  36.  
  37.     <!-- Copyright information. Optional -->
  38.     <!-- <copyright> -->
  39.  
  40.     <!-- Settings for the application's initial window. Required. -->
  41.     <initialwindow>
  42.         <!-- The main SWF or HTML file of the application. Required. -->
  43.         <!-- Note: In Flex Builder, the SWF reference is set automatically. -->
  44.         <content>[This value will be overwritten by Flex Builder in the output
  45.  
  46. app.xml]</content>
  47.        
  48.         <!-- The title of the main window. Optional. -->
  49.         <!-- <title> -->
  50.  
  51.         <!-- The type of system chrome to use (either "standard" or "none"). Optional.
  52.  
  53. Default standard. -->
  54.         <systemchrome>none</systemchrome>
  55.  
  56.         <!-- Whether the window is transparent. Only applicable when systemChrome is none.
  57.  
  58. Optional. Default false. -->
  59.         <transparent>true</transparent>
  60.  
  61.         <!-- Whether the window is initially visible. Optional. Default false. -->
  62.         <!-- <visible> -->
  63.  
  64.         <!-- Whether the user can minimize the window. Optional. Default true. -->
  65.         <!-- <minimizable> -->
  66.  
  67.         <!-- Whether the user can maximize the window. Optional. Default true. -->
  68.         <!-- <maximizable> -->
  69.  
  70.         <!-- Whether the user can resize the window. Optional. Default true. -->
  71.         <!-- <resizable> -->
  72.  
  73.         <!-- The window's initial width. Optional. -->
  74.         <!-- <width> -->
  75.  
  76.         <!-- The window's initial height. Optional. -->
  77.         <!-- <height> -->
  78.  
  79.         <!-- The window's initial x position. Optional. -->
  80.         <!-- <x> -->
  81.  
  82.         <!-- The window's initial y position. Optional. -->
  83.         <!-- <y> -->
  84.  
  85.         <!-- The window's minimum size, specified as a width/height pair, such as "400
  86.  
  87. 200". Optional. -->
  88.         <!-- <minSize> -->
  89.  
  90.         <!-- The window's initial maximum size, specified as a width/height pair, such as
  91.  
  92. "1600 1200". Optional. -->
  93.         <!-- <maxSize> -->
  94.     </initialwindow>
  95.  
  96.     <!-- The subpath of the standard default installation location to use. Optional. -->
  97.     <!-- <installFolder> -->
  98.  
  99.     <!-- The subpath of the Windows Start/Programs menu to use. Optional. -->
  100.     <!-- <programMenuFolder> -->
  101.  
  102.     <!-- The icon the system uses for the application. For at least one resolution,
  103.          specify the path to a PNG file included in the AIR package. Optional. -->
  104.     <!-- <icon>
  105.         <image16x16></image16x16>
  106.         <image32x32></image32x32>
  107.         <image48x48></image48x48>
  108.         <image128x128></image128x128>
  109.      -->
  110.  
  111.     <!-- Whether the application handles the update when a user double-clicks an update version
  112.     of the AIR file (true), or the default AIR application installer handles the update
  113.  
  114. (false).
  115.     Optional. Default false. -->
  116.     <!-- <customUpdateUI> -->
  117.    
  118.     <!-- Whether the application can be launched when the user clicks a link in a web browser.
  119.     Optional. Default false. -->
  120.     <!-- <allowBrowserInvocation> -->
  121.  
  122.     <!-- Listing of file types for which the application can register. Optional. -->
  123.     <!-- <fileTypes> -->
  124.  
  125.         <!-- Defines one file type. Optional. -->
  126.         <!-- <fileType> -->
  127.  
  128.             <!-- The name that the system displays for the registered file type.
  129.  
  130. Required. -->
  131.             <!-- <name> -->
  132.  
  133.             <!-- The extension to register. Required. -->
  134.             <!-- <extension> -->
  135.            
  136.             <!-- The description of the file type. Optional. -->
  137.             <!-- <description> -->
  138.            
  139.             <!-- The MIME type. Optional. -->
  140.             <!-- <contentType> -->
  141.            
  142.             <!-- The icon to display for the file type. Optional. -->
  143.             <!-- <icon>
  144.                 <image16x16></image16x16>
  145.                 <image32x32></image32x32>
  146.                 <image48x48></image48x48>
  147.                 <image128x128></image128x128>
  148.              -->
  149.            
  150.         <!-- </fileType> -->
  151.     <!-- </fileTypes> -->
  152.  
  153. </application>

Now the code in the mxml application:

[MXML]
< ? xml version="1.0" encoding="utf-8"? >
< mx : WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" >
< mx : HBox width="100%" >
< mx : Label text="ENDEREÇO:" / >
< mx : TextInput width="100%" id="link_txt" text="http://" / >
< mx : Button label="GO" click="h.location=link_txt.text" / >
< / mx : HBox>
< mx : HTML width="100%" height="100%" id="h" / >
< / mx : WindowedApplication >
[/MXML]

Running we have the following result, a browser made in Adobe AIR.

Following, we now generate the executable for this application that can be installed on the pc, noting that only will be installing the Adobe AIR is already installed on your computer.
To generate the executable, do the following: “File->Export->Release Build”.
In the first screen, no need to change anything in the next screen we have to configure the digital signature.

If you do not have any license to use, we can create one for testing, click “create” and the following screen appears:

Fill according to your taste, you create a file with the extension. Imbutida p12 to be in application and will be read when you run Adobe AIR application installation on your computer. Click in”Next”.
This screen will show the files that you wish to be included in the final application, by default the files are selected .swf and -app.xml.

Just click “Finish” and will create a file with the extension. Air and you have created your first application on Adobe AIR, if you already have Adobe AIR installed on your machine, just go to the directory where the executable was generated and give two clicks.

Enjoy yourself and test the application:
mybrowser

Some references:
DEVNET
Livedocs Flex 3
Adobe AIR resources
AIR for everyone
Business benefits
Browser vs. desktop
Download AIR applications

Recommended Books:


Translations:
Português do Brasil

Was this article helpful? feel free to make a donation and help keep the blog in the air
Adobe AIR