android: add LogListener

A Java object to send logs on the android side.
This commit is contained in:
Thomas Guillem
2014-11-02 16:52:43 +01:00
committed by Max Kellermann
parent 5af2632d4f
commit aff070bcbb
8 changed files with 102 additions and 4 deletions

View File

@@ -25,6 +25,12 @@ import android.content.Context;
* Bridge to native code.
*/
public class Bridge {
public static native void run(Context context);
/* used by jni */
public interface LogListener {
public void onLog(int priority, String msg);
}
public static native void run(Context context, LogListener logListener);
public static native void shutdown();
}

View File

@@ -69,7 +69,7 @@ public class Main extends Activity implements Runnable {
}
@Override public void run() {
Bridge.run(this);
Bridge.run(this, null);
quitHandler.sendMessage(quitHandler.obtainMessage());
}
}