Question

I need to wrap a C library with Adobe AIR native extension API (ANE).The extension should target IOS and Android.First,I realize that for Android , if not using NDK API , I have to port that library to Java.But my main concern is IO operations like read and write to file system which exist in that library.I read through the ANE development manual but found no note on restriction of native lib communication with the host file system.Does it mean my native library is allowed to read and write files inside AIR extension freely ?

Was it helpful?

Solution

You definitely can access the filesystem to read and write files.

The only thing of note here is that you'll only have access to the parts of the filesystem that the application has permission to access. So you basically just have to obey any restrictions that a normal native application developer has.

I've used the java.io.File to access files in ANE's no problem.

OTHER TIPS

Based on what I see scanning through that too it reads to me like it's doable but I can't confirm 100%

When you create a native extension, you provide the following:

ActionScript extension classes that you define. These ActionScript classes use the built-in ActionScript APIs that allow access to and data exchange with native code.

A native code implementation. The native code uses native code APIs that allow access to and data exchange with your ActionScript extension classes.

sounds to me like you have whatever native API available for writing your native extension in and they're just providing a "bridge" or "data tunnel" to communicate between the actionscript code and the native extension. They have one import from the android library for log in their example as well so I imagine you can use whatever objects/methods are available for each platform, I suppose the only real question is then what access the native process has on the file system for each platform. If you don't get an answer please try and post back (if I have time I'll do the same).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top