Is there a way that I can use C ++ exceptions in the Java Native Interface (JNI) library on Android?
EDIT: I'm talking about C ++ exception handling, which is completely internal to the JNI library. That is, the exception is thrown and gets into the library, and it never leaves the library.
According to the Android documentation (docs / CPLUSPLUS-SUPPORT.html), exceptions are only supported if I use "GNU libstdC ++" as the C ++ runtime instead of the standard one.
The problem is that the documentation also states that all parts of the program should use the same C ++ runtime:
"You can only choose one C ++ runtime that your code will depend on. It is not possible to combine common libraries compiled against different C ++ runtimes."
According to my interpretation, this means that I am forced to use the same C ++ as Dalvik (Java VM on Android).
So, if Dalvik does not use “GNU libstdc ++”, is there any other way that I could use in my JNI lib library?
What is C ++ runtime - is Dalvik compiled against?
EDIT: I have to assume that no matter what Java application uses my JNI library, you might also need to use other JNI libraries that I do not control. Does this limit my options in any way?
source share