[android-porting] creating a native thread communicating with Java via jni

2011-08-19 Thread chipantang
Hi, This perhaps is a basic question. I see Android framework provides AndroidRuntime::javaCreateThreadEtc(), so that the threads created with it get "hooked into VM before it really starts executing", per comment in the source code. I would like to understand what would be the differences if I

Re: [android-porting] creating a native thread communicating with Java via jni

2011-08-20 Thread Nigel Sheridan-Smith
You might run into issues if the thread you have created is not "attached" - i.e. you need to call some internal functions first so that the JNI environment is setup correctly from this thread. See attachThread and dvmAttachCurrentThread in dalvik/vm/Jni.c There might be other issues as well, but