About AIR Applications and Android Permissions

After I saw some tweets about issues related to accessing the Wi-Fi network from an AIR application running on Android I thought it would be worth writing a post about this topic.

If you have installed an Android application on your phone you know that during this process you are presented with a screen stating what permissions the application you are about to install will use: network communication, contact data, location, storage, and so on.

I think this is a good thing especially when dealing with applications from “not so trusted” sources. You have a last chance to decide if you are willing to install that app or not. Thus it is only natural Android apps built with Adobe AIR to follow the same rules. One more thing on security/permissions: I think it is a best practice, as a developer, to request the minimum permissions required for your application.

The way you set up these permissions is quite simple: you add an <android> node to your application descriptor file having the <application> node as the root (the application descriptor file is the XML file you already use for setting the different configuration options for your AIR application – application name, enabling the update framework, initial size and position, and so on). Here is an example:

Later Edit:

<android>
    <manifestAdditions>
        <manifest>
            <attribute name="android:installLocation" value="auto"/>
            <data>
            <![CDATA[
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                <uses-permission android:name="android.permission.INTERNET"/>
                <uses-permission android:name="android.permission.WAKE_LOCK"/>
                <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
                <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
                <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
            ]]>
            </data>
        </manifest>
    </manifestAdditions>
</android>

My colleague Ashutosh Sharma kindly pointed out that this mechanism was slightly changed recently:

<android>
    <manifestAdditions>
    <![CDATA[
    <manifest android:installLocation="auto">
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
        <uses-configuration android:reqFiveWayNav="true"/>
        <supports-screens android:normalScreens="true"/>
        <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
        <application android:enabled="true">
            <activity android:excludeFromRecents="false">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
            <activity>
            </activity>
        </application>
    </manifest>
    ]]>
    </manifestAdditions>
</android>

In this example I added an additional setting in the form of android:installLocation=”auto” as the attribute for the <manifest> node in order to allow the user to install the application either on the internal memory or on the SD memory card. The same way you can add additional permissions supported by the Android OS.

Now, next time when you have problems accessing resources from your AIR app on Android, you should know that this is the first thing to look for.

Hero is available

The next version of the Flex SDK, codename Hero, is available to you for download now. If you want to check this special builds just go here and download.

What is so special about Hero? Well, the most important thing is the added support for mobile development. So far you’ll find in this builds: Spark DataGrid, Spark Image, Spark Form, OSMF 1.0 integration, Mobile Application, View & View Navigator, and ActionBar. You can read more here.

No go and start play with it already :D!

Application Updater Library for AIR Native Installer Apps

My fellow evangelist, Piotr Walczyszyn, was very busy this summer tinkering with a number of projects that involve Adobe AIR. The latest one is library that enables you to update native AIR applications. You probably know that AIR 2 introduced a cool feature that lets you call processes from your AIR application (Native Processes API) as long as you package your application as a native installer (EXE, DMG, RPM etc). Once you do this, the built-in feature for update doesn’t work anymore.

If you want to have update capabilities with AIR 2 native installers you can use Piotr’s library or you can build your own mechanism. The choice is pretty simple, isn’t it?

Here is a video in which Piotr demos the library:

You can get the library from here or read Piotr’s post.

Adobe AIR Launchpad helps you creating AIR apps/projects

We’ve just launched Adobe AIR Launchpad: an AIR application that can speed up your AIR development.

How does AIR Launchpad help you? Here is a list of some of the features:

  • It creates the folder structure for an AIR application ready to compile with the settings you want it. For example, if you want to use auto update feature, then it will create the server side folder and files needed for this feature to work. If you’ve done AIR development you know that most the configuration options you need to set are stored inside of an XML file. Well, this application provides a user interface for setting these options. So it makes it easier to set up the icons used by the app, default width/height, or making the app transparent.
  • It creates an install badge if you need one (you can provide the image you want to be used).
  • It helps you to hook up listeners for events like Activation/Deactivation, Close event, Global Error.
  • It generates sample code for tasks like: Drag/Drop, Local Databases, Using Windows, HTML Component, Native Process, and many more.
  • It can create a ZIP file with all these folders/files so you can import this ZIP in Flash Builder and continue the working on the application using this IDE.

Here are some screenshots:

You can get this application from here.

LiveCycle Collaboration Service and Screen Sharing

LiveCycle Collaboration Service just got three new features that I’m pretty sure will make you very happy:

  • Screen Sharing. Yes, this is exactly what the names implies. Now, you can add screen sharing to your applications. Amazingly cool isn’t it?
  • Recording and Playback. You can record and download your collaborative session, and then playback this recording. You will see the data, audio, and video.
  • LCCS JavaScript SDK. We added JavaScript APIs and you can code your collaborative service using JavaScript. Though you still have to embed a SWF in your HTML page.

We also changed the domain name to something more meaningful: http://collaboration.adobelivecycle.com and we have a new logo for this service :).

You can read more on the team’s blog, and my fellow evangelist, Tom Krcha, has examples on his blog. Sign up here and get the SDK, use these forums to post questions and feedback, and learn about it here.

Upcoming webinars on the Flash Platform

The summer is almost over (at least in the northern hemisphere :D) which means you are in one of these two situations: either you just came back from vacation or you’re about to take one. Either way, I think you’ll find (some of) the webinars we are doing this month quite interesting. As usually, they are free; you just have to sign up and show up. A word of warning: because all four of these webinars are delivered by EMEA platform evangelist, we decided to schedule them in such a way that works for Europeans.

Here is the list:

Enjoy!

New Flash Player release enables H.264 GPU decoding on Mac OS X

We’ve just released a new version of Flash Player: 10.1.82.76, which includes support for H.264 video GPU decoding. This was previously available in a beta release code-named Gala. On top of this new cool feature, there were a number of bug fixes, so you definitely you should install it as soon as possible.

You can get the installers from here (including debugging versions). You can read about the security updates here.

LATER UPDATE:

I almost forgot to tell you about the new version of Adobe AIR (2.0.3). Like in the case of Flash Player, besides a number of bug fixes, we added support for GZIP compression for Windows (this was already available for Mac OS X and Linux).

You can get the runtime from here.

Working with Doctrine 2, Flex, Zend AMF, and Flash Builder

I finally got some time to play with Doctrine 2 and Flex. Back in May I wrote an article about working with Doctrine 1.x and Flex (you can read the article here) and my feelings were mixed. I chatted with Jonathan Wage of Doctrine about some of the shortcomings I found in Doctrine 1.x and his response was to check Doctrine 2 (still in development at the time of writing this article). Doctrine 2 is a big step forward.

In this article I describe how I rewrote the original application I created for my first article, this time using Doctrine 2, Flex 4, Zend Framework, and the Flash Builder data-centric development wizards. I’ll highlight the relevant differences between Doctrine 1 and Doctrine 2 along the way. Thus, you should find this article valuable in any one of these two cases:

  • You are already working with Doctrine 1 and you’ve wondered what it would take to move to version 2
  • You want to learn how to use Doctrine 2 with Flex; you know PHP and you know enough Flex not to be scared away if you see some snippets of code

Before going into the details let me say this: if you aren’t already using an ORM framework for PHP then you should. For most projects it can help you by freeing you of the tedious tasks of writing CRUD code and SQL queries. It allows you to focus on the business logic of your application. And all these advantages are multiplied when working on Rich Internet Applications because on this kind of project much of the work is done on the client and not on the server.

There are some aspects of using this ORM with RIA that could be better, but hey we don’t live in a perfect world. Most of these things, I think, are related to the fact that every time you use a server side ORM with a rich client, you leave behind the main story used for creating that framework – you use the ORM in order to feed a rich client with data and enable the client to persist the changes. Thus you need additional boiler plate code to make the whole thing work.

If you don’t know much about ORMs in general, you may want to read my first article first and before continuing.

Continue reading