home / blog

Tag Archives: jni

JNI helloworld

JNI is easy to use when you know how and frustrating when you don’t. I hope to demystify it and provide some pointers to when it goes wrong. Define your native methods using the native modifier. In this example we’ll … Continue reading

Posted in geek | Tagged , | Leave a comment

JNI asynchronous callbacks

If you’re using JNI, you may wish to callback a java method asynchronously. For example event handling from a win32 message pump. package com.adamish; public class Foo { public native void register(); public void callback(int val) { // do stuff … Continue reading

Posted in geek | Tagged , | 2 Comments