Posts in Category "AIR"

Native JSON API released

The Flash Player 11/AIR 3.0 (Serrano) release fulfills a long-standing developer request by introducing a native ActionScript JSON API. With this API, you can import and export objects using JSON encoding. Native JSON functionality correlates closely with the ECMA-262 (5.1 Edition) specification for JSON. Because of this, its syntax is somewhat different from the third-party as3corelib JSON library. You can find out more about these differences in community member Todd Anderson’s blog posting at the Infrared5 company blog.

The API itself consists of a top-level class named JSON. This class provides two methods: stringify() for encoding, and parse() for decoding JSON strings. The JSON feature also supports toJSON() member functions in any class. Visit the official documentation at these locations:

ActionScript 3.0 Reference
ActionScript 3.0 Developer’s Guide

Native extension detailed documentation

With the announcement of AIR 3 and its new native extension feature, detailed documentation about using Native Extensions for Adobe AIR is available now at:

Developing native extensions for Adobe AIR

You’ll find:

– Overview and conceptual information

– How to use the C and Java native extension APIs, plus reference pages

– How to package your native extension using ADT

– Details on the Extension Descriptor file

– Information on using Android shared libraries, and using resources on Android and iOS

If you are using a native extension in your AIR application, see:

Using native extensions in AIR applications

For lots of examples and tutorials, see this Adobe Developer Connection page:

http://www.adobe.com/devnet/air/native-extensions-for-air.htm

 

 

Putting the “Community” in community content

Over the past year we’ve been out in the community listening to issues and gathering content. The results of our labors have been  links and code samples added to our help pages. While we feel this makes our content more dynamic, it doesn’t do much unless you know it there. So, in an effort to get  more eyes on all this great community content, we’re spicing up our pages in a couple of ways:

In the spirit of giving credit where credit is due, here’s a list of some of authors we’ve highlighted so far:
If you have a great tutorials, videos or code sample you want to share, send it along. We’d love to add it to our content so everyone can benefit from your expertise.

iBattery native extension for Adobe AIR

Todd Anderson just posted “iBattery”,  a great example of a native extension for Adobe AIR on his blog.

His iBattery extension allows an AIR application to get the status of the battery of an iOS device — from ActionScript. Todd also gives a nice tutorial highlighting some of the details that go into creating a native extension.

You can see more examples of native extensions at the Adobe Developer Connection page http://www.adobe.com/devnet/air/native-extensions-for-air.html

Examples of Native extensions for Adobe AIR

Looking for some examples of native extensions for Adobe AIR?

Please see Native extensions for Adobe AIR on the Adobe Developer Connection.

This page lists three sample extensions developed by Adobe to help you learn how to create your own extensions. With native extensions, an AIR application developer, using ActionScript, can take advantage of platform-specific and device-specific native capabilities.

The examples include:

  • Vibration — From ActionScript, an AIR app can make an iOS or Android device vibrate.
  • Gyroscope — From ActionScript, an AIR app can access the gyroscope data of an iOS or Android device.
  • NetworkInfo — From ActionScript, an AIR app can get information about the network interfaces of an iOS device

Obviously, “from ActionScript” is the key. The extension’s ActionScript code interfaces with the extension’s native code, so that the AIR app developer only has to use ActionScript.

The ADC page also includes a link to a great example by Sean Fujiwara. His example uses .NET to efficiently  transcode BitmapData objects into .bmp, .jpg, and .png formats.  We hope to add more examples from the community soon.

 

Native extensions in AIR 3

The Adobe AIR 3 Release Candidate is available, and includes this new feature: Native extensions for Adobe AIR.

Until now, native extensions were available on AIR for TV, but not for AIR on desktop or mobile devices. Now you can create an ActionScript library that can execute native code on all these devices. This means an AIR application developer, using ActionScript, can take advantage of platform-specific and device-specific native capabilities.

We’ll blog here about documentation and examples as they become available. In the meantime, you can read more about it in this Adobe Developer Connection article:  Extending Adobe AIR.

And get the AIR 3 Release Candidate download to get started.

 

 

 

 

Develop AIR for TV apps for Samsung Smart TVs

You can now develop AIR 2.5.1  for TV apps for Samsung Smart TVs.

Register at  the Samsung D Forum to learn how to package AIR apps for Samsung Smart TVs.

Read this document:  AIR for TV Application Guide for Samsung TVs.  You will  need to login to the  Samsung D Forum to read the document, but you can quickly get a login id by following the instructions on the Samsung D Forum page.

You can learn more general information for developing AIR for TV apps at Developing AIR applications for television devices.

More information like samples,  tutorials, and articles are at Flash Platform for TV.

AIR for TV application documentation updates

Updates are now available to Developing AIR applications for television devices in Building Adobe AIR Applications on Adobe.com.

These updates include:

  • Design considerations. Remember all the entries on this blog that talked about various design considerations for AIR for TV apps? Now those tips plus others are available in the online documentation.
  • How to use Adobe Flash Professional CS5 and Adobe Flash Builder 4.5 to develop your AIR for TV application. This information includes how to build an application that uses an ActionScript extension.
  • How to use ADT to package an AIR for TV application that uses an ActionScript extension.
  • How to use ADL to test an AIR for TV application that uses an ActionScript extension.
  • General information on how to remotely debug an AIR for TV application running on the device. However, detailed steps depend on the device.

Beta ActionScript 3.0 Reference documentation available for Flash Player 10.3 Beta

The prerelease ActionScript 3.0 Reference for Flash Player 10.3 (“Wasabi”) Beta is now available. You can find this documentation here.

The Wasabi project represents the convergence of Flash Player and AIR streams into a single quarterly update.

Highlights include the following new features and classes:

Acoustic echo cancellation (Flash Player)
Exclude unwanted echo artifacts from microphone audio captures.

Media measurement (Flash Player)
Implement media usage analysis on the Flash Player platform rather than as a player plugin. Collect stats independently of the video player being used.

HTMLLoader updates (AIR)
The HTMLLoader class now dispatches locationChanging and locationChange events with a LocationChangeEvent object as the payload.

Important! To see the beta classes, remember to set your Runtimes filter to include Flash Player 10.3 and earlier.

Please use the Comments area at the bottom of each page to give us feedback on this beta documentation.

Managing graphics memory in AIR for TV apps

And here’s one more design consideration for AIR for TV application development…

This one continues the discussion from the blog entry called Using Graphics Hardware Acceleration in AIR for TV Apps.

To perform the accelerated graphics operations, hardware accelerators use special graphics memory. If your
application uses all the graphics memory, the application runs more slowly because AIR for TV reverts to using
software for the graphics operations.

To manage your application’s use of graphics memory:

  • When you are done using an image or other bitmap data, release its associated graphics memory. To do so, call the dispose() method of the bitmapData property of the Bitmap object. For example:

myBitmap.bitmapData.dispose();

Note: Releasing the reference to the BitmapData object does not immediately free the graphics memory. The runtime’s garbage collector eventually frees the graphics memory, but calling dispose() gives your application more control.

  • Use PerfMaster Deluxe, an AIR application that Adobe provides, to better understand the impact of hardware graphics acceleration on your target device. This application shows the frames per second to execute various operations. Use PerfMaster Deluxe to compare different implementations of the same operation.  For example, compare moving a bitmap image versus moving a vector image. PerfMaster Deluxe is available with the Adobe® AIR® for TV MAX 2010 Hardware Developer Kit, and will soon be available at Flash Platform so you can use it with other devices, too.

And don’t forget: Do not keep bitmap objects, or any objects, on the display list when they are not visible. Whether software or hardware renders a display object, rendering it when it is not visible needlessly uses resources to render the object. If you have a good reason to hold onto a display object when it is not visible, remove the object from the display list. This best practice applies not only for AIR for TV apps, but AIR apps and Flash Player apps on all devices (mobile, desktop, tablet, and TVs).