views:

61

answers:

1

Using AIR for Android, is it possible to call from Flex into an NDK library? If so, how can this be done?

I have a large C library that I need to use. I know that I can do this from an Android Java app (through JNI), but I have a large Flex codebase that I'd like to reuse.

A: 

I haven't used the NDK but I assume it outputs an apk file. If so then you can use the apk merging technique that I've posted in the AIR for Android prerelease forums (not public info yet because of the NDA for AIR on Android). The basic idea is that you use sockets to communicate between the AIR app and the Java or Native app. It's pretty simple but requires a few steps to do the apk merging.

James Ward
Actually, the NDK doesn't produce a .apk. It just lets you produce the files necessary for jni (.jar and .so), which you then use in your main application. Hm, it sounds like this technique means that you would actually have *two* apps: the flex app and another java/jni app.
paleozogt
Yup. And the Java APK would contain the .jar and .so from the NDK. Should work.
James Ward