Skip to main content
Participating Frequently
December 21, 2011
Question

Compile AIR apps against Android SDK 3.0+ to enable hardware acceleration

  • December 21, 2011
  • 2 replies
  • 2527 views

Hi at all,

i'd like to compile my AIR "Tablet" App against Android SDK 3.0+ to enable hardware acceleration.

I know that AIR only compiles against the Android 2.2 SDK.

In my ANT Build file:

<target name="package.android">

        <echo message="Packaging for Android"/>

        <java jar="${ADT.JAR}" fork="true" dir="${build.dir}" failonerror="true">

            <arg value="-package"/>

            <arg line="-target apk-emulator"/>

            <arg line="-storetype pkcs12"/>

            <arg line="-keystore ${cert}" />

            <arg line="-storepass ${cert.password}" />

            <arg value="${app.name}"/>

            <arg value="${app.name}-app.xml"/>

            <arg value="${app.name}.swf"/>

            <arg line="-platformsdk ${ANDROID_SDK_HOME}"/>

        </java>

</target>

ANDROID_SDK_HOME points to directory C:/android-sdk_r16-windows/, downloaded from http://developer.android.com/sdk/index.html, android-sdk_r16-windows.zip for Windows.

In my settings.properties file:

ANDROID_SDK_HOME = C:/android-sdk_r16-windows/

In my descriptior file:

<android>

    <manifestAdditions>

        <![CDATA[

            <manifest>

                <application android:hardwareAccelerated="true"/>

            </manifest>

        ]]>

    </manifestAdditions>

</android>

BUT when run my ANT build.xml file, JAVA shows me this error: [java] sdk must refer to a valid directory path.

From the Adode docs: First, download the Android 3 SDK: Android Developers: Installing the SDK . When packaging, set the -platformsdk option to the path containing the appropriate Android SDK (set the path to the directory containing the Android tools folder).

Where is the error!! Help me!

Thanks.

Francesco_C

This topic has been closed for replies.

2 replies

Participating Frequently
December 28, 2011

I HOPE THIS HELPS, IF YOUR TRYING TO FIX STAGEWEBVIEW RENDERING Hardware acc.

I was trying to figure this out aswell the other day... After falling down a Rabit Hole trying to figure out how to get "StageWebView" to render PDFs.  The issue was that  PDFs were being loaded in correctly and being displayed in the "Android Emulator" but once published onto the Android device the PDF wasn't displaying it would show as a blank window.... to make a long story short everything I had read was pointing to this "Hadware Acceleration issue" in that the forums were syaing that to "enable" "Browser plug-in" content in StageWebView this feature must be turned on.

After adjusting the ANDROID_SDK_HOME path under -------- Computer > System Properties  > Advanced System Settings > Environment Vatiables.... and getting Flash Builder to compiled against Android 3.0 SDK.

...... IT STILL DID NOT WORK.....( at which point I could have jumped out a window ) StageWebView still displayed a Blank PDF once published onto the Android device.   

Then I found a post about what is actually happening in the background of StageWebView and I think the mechanics of what is happeneing on the device are correct?, and the whole blank PDF display crap is actually because PDFs nativily in Android don't display in the Browser window, they attempt to download and then open in the Native application?

This  works on iPad AIR applications, etc. because PDF actually display in the Native browser window.  So theres definetly something missing on Android preventing this from working?

Dude if someon figures this out please good grief post a solution for displaying PDFs inside StageWebView on Android devices..... as it in some way pertains to Hardware Acceleration and Adnroid SDK 3.0

Participating Frequently
December 28, 2011

Hi Darkriderdesign,


where ANDROID_SDK_HOME path must be set under -------- Computer > System Properties  > Advanced System Settings > Environment Vatiables? System variables or User Variables? I do not even see the pdf on the emulator (Virtual Device with SDK 3.0)

I read this post: http://global.samsungtomorrow.com/?p=8894

Samsung Electronics plan to provide the Android 4.0 Ice Cream Sandwich update for GALAXY devices.

Ice Cream Sandwich brings an entirely new look and feel to Android. It has a redesigned user interface with improved multi-tasking, notifications, Wi-Fi hotspot, NFC support and a full Web browsing experience. Ice Cream Sandwich also features a new People App which lets users browse pictures, messages and social network updates from friends, family and co-workers.

Dude if someon figures this out please good grief post a solution for displaying PDFs inside StageWebView on Android devices..... as it in some way pertains to Hardware Acceleration and Adnroid SDK 3.0
Participating Frequently
December 28, 2011

I hope it's something that can be fixed.  If all we'll eventually have to do is upgrade to "Ice Creame Sandwich" that would be wonderful.

It's weird that the environment variable isn't there?  You could try installing the whole Android SDK again.  The easiest way to do this is to download Eclipse, and have Eclipse do it for you by doing the update software feature under help.  This may setup your ANDROID_SDK_HOME if not you could always make one yourself, by adding the Environeent variable and adding the path to the SDK on your machine.

You should see ADNROID_SDK_HOME here if your SDK is installed correctly?

Participant
December 28, 2011

I'm pulling my hair out over something with the packager as well, and I have no idea the answer to your question.  But in looking at your compiler args, you seem to be packaging for the emulator, correct?  I wonder if the SDK isn't found because of that and you should change apk-emulator to just apk.

Participating Frequently
December 28, 2011

Hi bengfarrell,

the issue was the Android SDK path in my PC (i suppose)

I installed the Android installer (installer_r16-windows.exe) directly in C:\ instead of C :\Program Files (x86)\etc... so the new path (points to the platform-tools folder) is ANDROID_SDK_HOME = C:/android-sdk

In the build.xml

<target name="package.android">

        <echo message="Packaging for Android"/>

        <java jar="${ADT.JAR}" fork="true" dir="${build.dir}" failonerror="true">

            <arg value="-package"/>

            <arg line="-target apk"/>

            <arg line="-storetype pkcs12"/>

            <arg line="-keystore ${cert}" />

            <arg line="-storepass ${cert.password}" />

            <arg value="${app.name}"/>

            <arg value="${app.name}-app.xml"/>

            <arg value="${app.name}.swf"/>

            <arg line="-platformsdk ${ANDROID_SDK_HOME}"/>

            <arg value="assets" />

        </java>

    </target>

F