mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
fixed native code loading issues
This commit is contained in:
parent
260252f2b3
commit
5be53fae58
3 changed files with 11 additions and 4 deletions
|
@ -18,6 +18,11 @@ include $(BUILD_SHARED_LIBRARY)
|
|||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := NativeFormats-v1
|
||||
LOCAL_SRC_FILES := $(wildcard NativeFormats/*.cpp) $(wildcard NativeFormats/util/*.cpp)
|
||||
LOCAL_SRC_FILES := \
|
||||
NativeFormats/JavaNativeFormatPlugin.cpp \
|
||||
NativeFormats/JavaPluginCollection.cpp \
|
||||
NativeFormats/util/AndroidUtil.cpp
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/NativeFormats/util
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include <jni.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <AndroidUtil.h>
|
||||
|
||||
extern "C"
|
||||
|
@ -26,7 +28,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_geometerplus_fbreader_formats_PluginColl
|
|||
//const std::vector<shared_ptr<FormatPlugin> > plugins = PluginCollection::Instance().plugins();
|
||||
const size_t size = 0;//plugins.size();
|
||||
jclass cls = env->FindClass(AndroidUtil::Class_NativeFormatPlugin);
|
||||
jobjectArray javaPlugins = env->NewObjectArray(size, cls, NULL);
|
||||
jobjectArray javaPlugins = env->NewObjectArray(size, cls, 0);
|
||||
|
||||
/*
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public class PluginCollection {
|
|||
ourInstance = new PluginCollection();
|
||||
|
||||
// This code can not be moved to constructor because nativePlugins() is a native method
|
||||
for (FormatPlugin p : ourInstance.nativePlugins()) {
|
||||
for (NativeFormatPlugin p : ourInstance.nativePlugins()) {
|
||||
ourInstance.addPlugin(p);
|
||||
}
|
||||
}
|
||||
|
@ -114,5 +114,5 @@ public class PluginCollection {
|
|||
}
|
||||
}
|
||||
|
||||
private native FormatPlugin[] nativePlugins();
|
||||
private native NativeFormatPlugin[] nativePlugins();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue