Reputation: 897
i'm try to write first native android application and get follow Error There are solution package explorer photo and source code for each of changed file: package ua.org.groupab;
import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
public class ProjActivity extends Activity {
static {
System.loadLibrary("ndkfoo");
}
private native String invokeNativeFunction();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String hello = invokeNativeFunction();
new AlertDialog.Builder(this).setMessage(hello).show();
}
}
What's wrong in me code? Help please!
Upvotes: 0
Views: 411
Reputation: 3937
in ndkfoo.c in the function declaration, it will be valid if the package name in the function must match with your package name
change the declaration in ndkfoo.c into
jstring Java_ua_org_groupab_ProjActivity_invokeNativeFunction()
{
}
Upvotes: 1