开发者

Can an Android AIR app call an NDK library?

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.


Yes you can do this, you'll need to use the C api. Instead of just adding the FlashRuntimeExtensions.h file to your project you have to link against FlashRuntimeExtensions.so (can be found in the AIR sdk under lib/android) in your Android.mk file.

Like this: LOCAL_LDLIBS := -llog FlashRuntimeExtensions.so


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜