JNI problem   : from c Languege call Java

i think from c Languege call Java,
but that CallIntMethod() return value is not equals getIpv6() -> 99,
CallIntMethod() its always return strange value is [-1091242504] or
[11212] .

additional i already slove [Method not found: 'getIpv6' '(I;)I']
error.

please help me!


java Language:
        public void onCreate() {
                setConnecCallback2();
        }

        public static native void  setConnecCallback2();

        public int getIpv6(int ipv6){

        Log.i("JNI", "Callback from Native Messenger to Java Hello Chat");

                return 99;
        }

        static {
                System.loadLibrary("mm");
        }


cLanguage:
#include <string.h>
#include <jni.h>
#include <stdio.h>
#include <pthread.h>


JNIEXPORT void JNICALL Java_com_ServersService_setConnecCallback2
(JNIEnv *env, jobject this) {

        FILE *fd;
    fd = fopen("/sdcard/made.log", "w");

        jclass jcCallback = (*env)->FindClass(env,"com.ServersService");

        jmethodID mid = (*env)->GetMethodID(env,jcCallback,"getIpv6","(I)I");

        int ii =  (int)(*env)->CallIntMethod(env, jcCallback  ,mid, 444 );


        fprintf(fd, "iii is : [%d] \n",  ii);
        fclose(fd);

        return;
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to