[sword-svn] r3570 - in trunk/bindings: Android/SWORD/app java-jni/jni
scribe at crosswire.org
scribe at crosswire.org
Mon Feb 19 18:56:23 MST 2018
Author: scribe
Date: 2018-02-19 18:56:23 -0700 (Mon, 19 Feb 2018)
New Revision: 3570
Modified:
trunk/bindings/Android/SWORD/app/CMakeLists.txt
trunk/bindings/java-jni/jni/swordstub.cpp
Log:
updated Android ndk jni bindings to work with latest BibleSync
Modified: trunk/bindings/Android/SWORD/app/CMakeLists.txt
===================================================================
--- trunk/bindings/Android/SWORD/app/CMakeLists.txt 2018-02-19 01:56:06 UTC (rev 3569)
+++ trunk/bindings/Android/SWORD/app/CMakeLists.txt 2018-02-20 01:56:23 UTC (rev 3570)
@@ -5,6 +5,7 @@
cmake_minimum_required(VERSION 3.4.1)
+SET(CMAKE_C_FLAGS "-DBIBLESYNC ${CMAKE_C_FLAGS}")
#SET(NDK_DEBUG 0)
SET(CMAKE_C_FLAGS "-D__unix__ ${CMAKE_C_FLAGS}")
SET(CMAKE_C_FLAGS "-D_FTPLIB_NO_COMPAT ${CMAKE_C_FLAGS}")
@@ -190,9 +191,18 @@
../../../../src/frontend/swlog.cpp
../../../../src/utilfuns/zlib/untgz.c
+
+ ../../../../../biblesync/src/biblesync.cc
+ ../../../../../biblesync/src/ifaddrs.c
+
)
-include_directories(../../../../include)
+include_directories(
+ ../../../../include
+
+ ../../../../../biblesync/include
+
+ )
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp 2018-02-19 01:56:06 UTC (rev 3569)
+++ trunk/bindings/java-jni/jni/swordstub.cpp 2018-02-20 01:56:23 UTC (rev 3570)
@@ -39,7 +39,6 @@
#include <installmgr.h>
#include <remotetrans.h>
#include <rtfhtml.h>
-//#include <android/native_activity.h>
#ifdef BIBLESYNC
@@ -219,8 +218,8 @@
}
#ifdef BIBLESYNC
-void bibleSyncCallback(char cmd, string bible, string ref, string alt, string group, string domain, string info, string dump) {
-SWLog::getSystemLog()->logDebug("bibleSync callback msg: %c; bible: %s; ref: %s; alt: %s; group: %s; domain: %s; info: %s; dump: %s", cmd, bible.c_str(), ref.c_str(), alt.c_str(), group.c_str(), domain.c_str(), info.c_str(), dump.c_str());
+void bibleSyncCallback(char cmd, string pkt_uuid, string bible, string ref, string alt, string group, string domain, string info, string dump) {
+SWLog::getSystemLog()->logDebug("bibleSync callback msg: %c; pkt_uuid: %s; bible: %s; ref: %s; alt: %s; group: %s; domain: %s; info: %s; dump: %s", cmd, pkt_uuid.c_str(), bible.c_str(), ref.c_str(), alt.c_str(), group.c_str(), domain.c_str(), info.c_str(), dump.c_str());
if (::bibleSyncListener) {
SWLog::getSystemLog()->logDebug("bibleSync listener is true");
jclass cls = bibleSyncListenerEnv->GetObjectClass(::bibleSyncListener);
@@ -1933,6 +1932,7 @@
*/
JNIEXPORT void JNICALL Java_org_crosswire_android_sword_SWMgr_sendBibleSyncMessage
(JNIEnv *env, jobject me, jstring osisRefJS) {
+SWLog::getSystemLog()->logDebug("libsword: sendBibleSyncMessage() begin");
initBibleSync();
const char *osisRef = env->GetStringUTFChars(osisRefJS, NULL);
@@ -1954,8 +1954,8 @@
JNIEXPORT void JNICALL Java_org_crosswire_android_sword_SWMgr_registerBibleSyncListener
(JNIEnv *env, jobject me, jobject bibleSyncListener) {
+SWLog::getSystemLog()->logDebug("registerBibleSyncListener() start");
#ifdef BIBLESYNC
-SWLog::getSystemLog()->logDebug("registerBibleSyncListener");
::bibleSyncListener = bibleSyncListener;
::bibleSyncListenerEnv = env;
SWLog::getSystemLog()->logDebug("registerBibleSyncListener - calling init");
@@ -1967,6 +1967,8 @@
SWLog::getSystemLog()->logDebug("bibleSyncListener - sleeping for 2 seconds");
sleep(2);
}
+#else
+SWLog::getSystemLog()->logDebug("registerBibleSyncListener: !!! BibleSync disabled in native code.");
#endif
}
More information about the sword-cvs
mailing list