From aff070bcbb771a5096f02b60c84aacfde601e043 Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Sun, 2 Nov 2014 16:52:43 +0100 Subject: android: add LogListener A Java object to send logs on the android side. --- android/src/Bridge.java | 8 +++++++- android/src/Main.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'android') diff --git a/android/src/Bridge.java b/android/src/Bridge.java index be8eabb6b..fad919204 100644 --- a/android/src/Bridge.java +++ b/android/src/Bridge.java @@ -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(); } diff --git a/android/src/Main.java b/android/src/Main.java index da64a1976..816b62cdb 100644 --- a/android/src/Main.java +++ b/android/src/Main.java @@ -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()); } } -- cgit v1.2.3