NDK : how to return String, Int From Native Code

Step one : Return String from your code


jstring Java_com_manoj_hellojni_HelloJni_stringFromJNI(JNIEnv* env,
        jobject thiz) {
    return (*env)->NewStringUTF(env, "stringFromJNI !");
}


Step Two : Return integer from your code

Java_com_manoj_hellojni_HelloJni_getTwoNumMul(JNIEnv *env, jobject obj,
        jint first, jint second) {
     jint mul = first*second;
    return mul;
}

Comments

Popular posts from this blog

Bluetooth Data Transfer Example

DeCompile .apk file on ubuntu 14.04