Find solution

How to call java from c#?

Here are 19 best answers to ‘How to call java from c#?’ - the most relevant comments and solutions are submitted by users of Stack Overflow, Yahoo! Answers and Quora.

Best solution

  • How to call Java API from NDK C++ thread?

    I want to call Java API from NDK C++ thread, but env->FindClass() return 0. But when I call Java API in main thread, it works well. I've already call AttachCurrentThread() in the thread, can anyone help me? Here is the source code: JAVA CODE: public class simple_test extends Activity { ... // This functin will be called in C++ public void PrintNdkLog(String slog) { Log.e(logTagNDK, slog); return; } } C++ CODE: static JavaVM* g_JavaVM = NULL; jobject getInstance(JNIEnv *env, jclass obj_class...

    Answer:

    I have solved it now. In NDK native thread, only can call static Java API. If you call env->FindClass...

    Mark as irrelevant Undo

Other solutions