Activity代码:
package com.test.jniclass;
import android.app.Activity;
import android.os.Bundle;
public class AndroidJniClassDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
executeMethod();
}
private void show(){
System.out.println("AndroidJniClassDemo show function");
}
private int intShow(){
System.out.println("AndroidJniClassDemo intShow function");
return 1;
}
private native void executeMethod();
static{
System.loadLibrary("AndroidJniDemo");
}
.c文件代码:
#include<jni.h>
#include<stdio.h>
#include<android/log.h>
JNIEXPORT void JNICALL Java_com_tes