java-native-interface

Android NDK: no archive symbol table (run ranlib)

廉价感情. 提交于 2020-06-14 06:12:33
问题 I am updating my projects to use Android ndk 16b and it was previously using 12b (was working fine). After I updated, I am running into the following error while building the final .so: /Users/ssk/code/client/git/thirdparty/android-ndk-r16b/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: jni/../../../shared-library/SharedCommon/build/arm-linux-androideabi/lib/libSharedCommon.a: no

How to pass a Data from native c binary to android model using JNI?

筅森魡賤 提交于 2020-06-13 07:46:10
问题 I am trying to pass a value from C++ header file named recognizer.h to Android through my JNI implementation in jni_face_rec.cpp . recognizer.h #pragma once #include <dlib/dnn.h> #include <dlib/string.h> #include <jni_common/jni_fileutils.h> #include <jni_common/jni_utils.h> #include <dlib/image_processing.h> #include <dlib/image_processing/frontal_face_detector.h> #include <dlib/opencv/cv_image.h> #include <dlib/image_loader/load_image.h> #include <glog/logging.h> #include <jni.h> #include

Where can I find the jni headers for Mac OS

无人久伴 提交于 2020-06-08 07:18:47
问题 I'm not asking where I can find it on my own computer , I'm asking where I can get it. I've done my google homework, and I didn't find the headers in those paths. There wasn't even a Header folder in my /System/Library/Java/JavaVirtualMachines/... and stuff and I don't have a Developer folder under root. Now I'm pretty sure I don't have those headers installed, I checked the MacOS developer website but I only found some broken links. Shouldn't OpenJDK or SunJDK provide the jni.h header for

Error when connecting to native library: E/eglCodecCommon: GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1

╄→гoц情女王★ 提交于 2020-06-01 07:42:29
问题 I am trying to pass data to a native C library within a Java Android app and i keep getting this error? HostConnection::get() New Host Connection established 0xe209a150, tid 16633 D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL

How do i add openssl library in android studio? [closed]

本小妞迷上赌 提交于 2020-06-01 05:36:06
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 days ago . I want to implement AES and RSA encryption in my project using ndk(not using java API).by brief study i coming to know that i need to add openssl for achieving my task. i downloaded library from here openssl. but that contains plenty of files. i am confused what to do with that.is

How to parse a zipped file completely from RAM?

柔情痞子 提交于 2020-05-29 06:01:06
问题 Background I need to parse some zip files of various types (getting some inner files content for one purpose or another, including getting their names). Some of the files are not reachable via file-path, as Android has Uri to reach them, and as sometimes the zip file is inside another zip file. With the push to use SAF, it's even less possible to use file-path in some cases. For this, we have 2 main ways to handle: ZipFile class and ZipInputStream class. The problem When we have a file-path,

Passing byte array from native code to the Java side

流过昼夜 提交于 2020-05-25 04:19:30
问题 My goal is passing a byte array of variable length from native code to Java side. The Java class instance method takes bytearray as its argument: private void writeBuffer(final byte[] buffer) { } I am able to find a method ID in the native code: jclass cls = (*env)->FindClass(env,"class_path"); jmethodID writeBufferMethodID = (*env)->GetMethodID(env, cls, "writeBuffer", "([B)V"); But still can't figure out how to pass a byte array properly. I have tried: jbyteArray retArray = (*env)-

Passing byte array from native code to the Java side

試著忘記壹切 提交于 2020-05-25 04:18:53
问题 My goal is passing a byte array of variable length from native code to Java side. The Java class instance method takes bytearray as its argument: private void writeBuffer(final byte[] buffer) { } I am able to find a method ID in the native code: jclass cls = (*env)->FindClass(env,"class_path"); jmethodID writeBufferMethodID = (*env)->GetMethodID(env, cls, "writeBuffer", "([B)V"); But still can't figure out how to pass a byte array properly. I have tried: jbyteArray retArray = (*env)-

Passing byte array from native code to the Java side

六月ゝ 毕业季﹏ 提交于 2020-05-25 04:17:36
问题 My goal is passing a byte array of variable length from native code to Java side. The Java class instance method takes bytearray as its argument: private void writeBuffer(final byte[] buffer) { } I am able to find a method ID in the native code: jclass cls = (*env)->FindClass(env,"class_path"); jmethodID writeBufferMethodID = (*env)->GetMethodID(env, cls, "writeBuffer", "([B)V"); But still can't figure out how to pass a byte array properly. I have tried: jbyteArray retArray = (*env)-

JNA passing the equivalent of swift pointer from Java Android to C

天大地大妈咪最大 提交于 2020-05-17 07:45:09
问题 I am a little stuck trying to pass an implementation of this Swift code in Java, to C. Would appreciate any advice i am using JNA to integrate between the Java and Matlab generated C code. This is the Swift call: GetResult(uptime, &result_out) It Maps to the C code: void GetResult(double time, Result_t *Result) The C struct Result_t is too big for here, however it is a combination of double's and int's. I understand &result_out is a swift pointer? How is it best to go about implementing the