NDK on android frameworks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

NDK on android frameworks

Zacchaeus Liang

Hello i've been trying to call a JNI library in Android Keyguard (frameworks/base/packages/SystemUI). I was able to do it in Android Settings but now I need it to be called in Keyguard. Currently, the Shared object is being built. It's located in the /system/lib64 (my one used in android settings is also located in the 32 bit lib) location. It's not being called when I'm supposed to use it. No errors are shown on logcat saying that the jni is missing.

My Android.mk File in the /jni folder.

LOCAL_PATH := $(call my-dir)
include $
(CLEAR_VARS)
LOCAL_MULTILIB := both
LOCAL_MODULE := liblock-jni
LOCAL_SRC_FILES := lock-jni.c
LOCAL_C_INCLUDES +=$(JNI_H_INCLUDE)
LOCAL_CFLAGS += -O0 -g3
include $(BUILD_SHARED_LIBRARY)

This is the declaration in my function for the java class.

JNIEXPORT jstring JNICALL Java_com_android_keyguard_LockJni_stringFromJNI(JNIEnv *env, jobject thisObj , jstring inJNIStr) {

I've got a method defined like this to call it in my jni class. This is located in SystemUI/Keygard.

package com.android.keyguard;


import android.app.Activity;
import android.widget.TextView;
import android.os.Bundle;
import android.util.Log;



public class LockJni
{

    public native String  stringFromJNI(String param);

    static {
           Log.d( "library loaded:", "hello");


        System.loadLibrary("lock-jni");
    }
                public LockJni(){

                }
}

Thanks for the help!!

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/83ca21b8-00fa-426d-8ccf-10373c21d1ccn%40googlegroups.com.