1

I have a C++ api I can't change which:

  • exposes object (easy)
  • exposes interfaces that have to be derived by caller (classical trigger-listener design pattern).

I managed to wrap this API to python using SWIG and the director feature, which allows cross-language derivation. However, when I tried to compile it using ndk, to expose it in Dalvik's VM in Android, I discovered that directors in SWIG are supported through RTTI, and that Android does not support RTTI.

Any idea on how I could workaround this limitation? Basically, I have an easy way of exposing my native objects in Java using JNI and SWIG, but I need to be able to trigger my Java code from native code.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Bruce
  • 7,094
  • 1
  • 25
  • 42

2 Answers2

1

Android does support RTTI and exceptions from NDK r5. Just add -fexceptions and -frtti compilation flags and also add line APP_STL := gnustl_static to the Application.mk file.

Michael
  • 53,859
  • 22
  • 133
  • 139
-1

you'll need to write your own JNI that doesn't use RTTI, i'm afraid.

Elliott Hughes
  • 4,595
  • 2
  • 23
  • 21