Posts tagged "Mobile"

Optimizing network interaction in mobile applications

Optimizing Performance for the Flash Platform is filled with tips to make faster, more efficient Flash Player and AIR applications for desktop, mobile, and TV devices.

The chapter called Optimizing network interaction has some tips worth reviewing:

  • Use smart seeking.  Smart seeking improves performance when a user seeks to a new destination in a streaming video. Use Netstream.inBufferSeek.  (Adobe Flash Media Server 3.5.3 or greater required)
  • Divide your app into multiple SWF files. Multiple smaller SWF files means your content loads faster, especially on mobile devices with limited access to the network.
  • Provide event handlers and error messages for IO errors. Because network access can be less reliable on a mobile device, be sure to catch every IO error and keep the user informed.
  • Use Flash Remoting and AMF for optimized client-server data communication. As a binary format, Action Message Format (AMF) reduces the size of the data, improving the speed of transmission. Flash Remoting gateways, such as  ZendAMF, FluorineFX, WebORB, and BlazeDS, know how to handle the AMF format on behalf of the server side.
  • Cache assets locally after loading them. Avoid unnecessary loads from the network by saving files to the local file system, by using SharedObjects, or by saving data to a local database.

For more details on these tips, and other topics such as conserving memory and improving rendering performance, visit Optimizing Performance for the Flash Platform.

Jackie Levy, Content and Community Lead

Optimizing Flash and AIR applications for mobile

Looking for ways to build incredibly speedy Flash or AIR applications for mobile devices? If so, look no further than Optimizing Performance for the Flash Platform. Released last year, this guide is brimming with valuable tidbits, provided in part by Adobe’s own Thibault Imbert. It offers tips for optimizing performance on mobile devices, desktops and TVs, ranging from basic ActionScript best practices to sophisticated graphics rendering techniques.

Here are a couple of simple ActionScript optimizations from the Miscellaneous optimizations section of the ActionScript 3.0 performance chapter.

Avoid evaluating statements in loops
Another optimization can be achieved by not evaluating a statement inside a loop. The following code iterates over an array, but is not optimized because the array length is evaluated for each iteration:

for (var i:int = 0; i< myArray.length; i++)
{
}

It is better to store the value and reuse it:

var lng:int = myArray.length;
for (var i:int = 0; i< lng; i++)
{
}

Use reverse order for while loops
A while loop in reverse order is faster than a forward loop:

var i:int = myArray.length;
while (--i > -1)
{
}

These tips provide a few ways to optimize ActionScript, showing how a single line of code can affect performance and memory. Many other ActionScript optimizations are possible. For more information,
see http://www.rozengain.com/blog/2007/05/01/some-actionscript-30-optimizations.

Test your Flash Platform Android apps now, without a phone

Writing Flash Platform applications for Android, or designing Flash content for mobile users and want to see the content emulated on specific mobile devices? Adobe Device Central CS5 has profiles for many mobile devices so you can test your applications without owning the device.

Since Adobe just released the official Motorola Droid X profile for Android, you can test your Android 2.2 (aka “Froyo”) apps and sites now and get the phone later.

To test apps In Flash Professional CS5

With your FLA file open, select Control > Test Movie > in Device Central. Select the device you want in the Test Devices panel. The application appears in the emulator:

emulateX.gif

To get new devices

In Device Central, click Browse and then search for a keyword, like “Droid” to see what’s available:

browseprofiles.gif

Click and drag new profiles, like the Motorola Droid or Motorola Droid X, to your list of Test Devices.

If you don’t see the profile you want, come back soon; the community is posting new profiles daily and Adobe posts official profiles as they are finalized.

To get back to the list of devices at any time

Click Browse and the Home button:

homeprofiles.gif

Click Emulate Flash to get back to testing in the emulator

To test mobile-specific features, like the Accelerometer

If a phone’s profile supports accelerometer or other mobile features, you can test them in Device Central. The Accelerometer panel lets you simulate moving the device in three
dimensions. Alt+Click simulates multiple finger touches and the Multitouch panel lets you set touch size and pressure. The Geolocation panel lets you test GPS features, and other panels
provide even more information:

devicefeature.gif

Device Central works with Dreamweaver and several other Adobe products. Test your entire Flash-enabled Web site for mobile browsing using Device Central (including HTML5 sites).

Related links:

Sweet video description of organizing classes, implementing mobile feature APIs and using Device Central by Adobe’s Mark Doherty: http://www.flashmobileblog.com/2010/04/14/device-central-cs5-multitouch-and-debugger/

Device Central Support page: http://www.adobe.com/support/devicecentral/

Twitter updates for Device Central profiles: http://twitter.com/devicecentral

Dreamweaver HTML5 Pack extension: http://labs.adobe.com/downloads/html5pack.html

Dreamwever testing mobile content in Device Central Adobe TV page: http://tv.adobe.com/watch/learn-dreamweaver-cs5/testing-mobile-content-with-adobe-device-central/

Using Device Anywhere (an alternative to Device Central) for testing: http://www.adobe.com/devnet/devices/articles/device_anywhere.html