tags:

views:

296

answers:

1

hi,everyone:

I just face a problem while devloping a native c/c++ share library for android platform, as we all know that the Android use the Java language for the upper layer developement,now i have ported my Engine code using ASCII c/c++ to the android using it's bionic library ,yet when needing to design the User Interface, i have to use the JNI to call my engine code. As far as i know, that is the only choice , the problem is my engine own hundrends of export APIs. If i use the JNI tech., i need to wrap these APIs to a new share library for use , it will cost a lot of time for devlopement and testing. Can somebody support some suggestions for this situation? I do not familiar with java or JNI tech by the way.

TIPS: When i search the Google, i found some open source for JNI generator such as JNative etc. Untile NOW I do not know is it suitable for Android platform.

A: 

You can easily use SWIG www.swig.org which will generate the JNI bindings for you. there is nothing android-specific in that operation, so it will work rather out-of-the-box.

Reflog
really? that's really so cool if swing can solve this problem, i will check the details, Thanks Reflog.
Eric