AIR 3.0 Native Extensions and Samples
with 15 comments
This new capability allows developers to:
- Achieve deeper integration with target devices
- Incorporate legacy native code in their application
- Achieve maximum performance for critical code
I am not going to delve into what the feature introduces a developer to, for the same one may go ahead and read this article by Oliver Goldman.
Following are the links to the various Native Extensions that have been built and are available for ready use:
- A Hello World example to beign with
- Push Notification native extension sample for Android and iOS
- Licensing Adobe AIR applications on Android
- Gyroscope native extension sample
- NetworkInfo native extension sample
- Vibration native extension sample
- iBattery for iOS native extension sample
- Image Processor native extension sample for Windows
- Kinect native extension library
- Android Cloud to Device Messaging Framework native extension library
- Read Pressure Sensitivity of a Pen Tablet on Windows
If you know of more example extensions that are publicly available, please drop a comment and I will include them in the list.
written by Sandeep Gupta
Tuesday, October 4, 2011 at 1:50 PM
Labels: ActionScript , Adobe AIR
Comments
15 responses to ' AIR 3.0 Native Extensions and Samples '
-
Hi Can I read android .so shared library extension over airt native extension? I seen that it supports but I could not find any examples.
-
Hi Can I read android .so shared library extension over airt native extension? I seen that it supports but I could not find any examples
-
Hi Marin, As far as I know, you can read the .so shared libraries using ANE. ANE just wraps over existing native code like DLL for Windows, Framework on Mac. I will try and dig more into it and keep you posted.
-
Hi Sandy, thanks for your fast response. I did that, but it throws Linkage exception. What implies that the .so is not in classpath. So, I unziped the final AIR apk and saw that my .so libs are not there. If I somehow get them inside the APK it might work.
-
Hi Marin, I haven't done that myself before so I may have to ask a couple of folks around if they have experienced it before. Gimme a day or two and I will find out it it's supported or not.
Getting the .so file in the APK should not be a problem I guess, one can include it as just another asset in the app:// location. -
Hey Sandy thanks very much for your effort. Considering getting .so into the .apk. I was able to get into the .apk but not into the lib folder of apk in order to be in classpath. Can you give me some hint how to do it?
Thanks. -
Hi
Tks very much for post:
I like it and hope that you continue posting.
Let me show other source that may be good for community.
Source: Compliance officer interview questions
Best rgs
David -
Hi Marin,
I confirmed with AIR guys and you can for sure use .so files with native extensions on Android. The following links should help you get started,
http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7fff.html
To put the .SO file in the right location refer to the document, http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html.
Hope this helps.
~ Sandeep -
Hi Sandy,
Thanks very much, but it does not work this way. This way the libs are stored in ANE/Android-ARM/libs which does not work. However, there is a way. I unpacked the apk and added libraries to main lib folder and then sign it. This way it is too time consuming. If there is easier way please inform me. Thanks -
Hi Marin,
Let me check with the AIR folks again on the same and see if there is a straight forward solution to this or not.
~ Sandeep -
I would also appreciate an answer to this question. I have a .jar file which is providing the implementation for an extension, but that .jar then in turn makes use of native code in an .so and I'm looking for a way to get the 2 versions of that .so into
lib/armeabi/
lib/armeabi-v7a/ -
Hi Matt,
I will try and find out the answer to the same.
Marin, sorry but I haven't yet heard from other folks on the solution. Will ping them again.
~ Sandeep -
Marin,
How did you sign your APK? I've tried the same thing you mentioned about unzipping the apk, adding the files, then re-zipping - but there is some sort of signing problem because the updated APK complains at runtime that there are no certs.
Did you have to do anything unusual to get the re-sign working correctly? -
hi all
i have some same related problem
i have managed to place a .so file inside the ANE
(arith.so)
and i use the code
System.loadLibrary("arith");
to use it
but it fails to find it at runtime
i think it is not looking on the current folder for it
any ideas? -
I had the same problem until I updated my build script to copy the .so files into the build folders that are operated on under ADT.
ex:
< !-- Copy Android lib in binaries folder -->
< target name="androidCopy" depends="androidExport">
< copy file="${ANDROID_LIB_PATH}" todir="${BINARIES_FOLDER}/Android"/>
< copy todir="${BINARIES_FOLDER}/Android/libs/armeabi-v7a">
< fileset dir="${ANDROID_LIBS_FOLDER}/armeabi-v7a" />
< /copy>
< copy todir="${BINARIES_FOLDER}/Android/libs/armeabi">
< fileset dir="${ANDROID_LIBS_FOLDER}/armeabi" />
< /copy>
< /target>
Then make sure you see the .so files in the ANE that was compiled.
