Skip to content

Instantly share code, notes, and snippets.

@aaronbartell
Last active August 29, 2015 14:06
Show Gist options
  • Save aaronbartell/03aebc039b4ab390947c to your computer and use it in GitHub Desktop.
Save aaronbartell/03aebc039b4ab390947c to your computer and use it in GitHub Desktop.
public class PaseExample1 {
public static void main(String args[]) {
PaseExample1 pe1 = new PaseExample1("String for PaseExample1");
pe1.printString();
}
String str;
PaseExample1(String s) {
str = s;
}
//-----------------------------------------------------------------
public void printString() {
String result = getStringNative();
System.out.println("Value of str is '" + result + "'");
}
// This calls getStringCallback through JNI.
public native String getStringNative();
// Called by getStringNative via JNI.
public String getStringCallback() {
return str;
}
static {
System.loadLibrary("PaseExample1");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment