Questions tagged [jniwrapper]
54 questions
1
vote
1 answer
Loading JNI library in another JNI library crashes
I'm essentially trying to follow a SO solution described here, but am running into a problem.
This is essentially what I am doing fron inside a JNI library:
handle = dlopen("/data/data/lib/my.package/lib/myLibrary.so", RTLD_LAZY);
myFunctionName =…

Cigogne Eveillée
- 2,178
- 22
- 36
1
vote
1 answer
Access android view in cocos2d-x scene?
I am making demo app in cocos2d-x where I am trying to integrate admob ads in that. I am adding it in to the game_demo.xml layout where cocos2dx GLSurfaceview is getting added. It works proper throughout the cocos2d-x scenes. But now If I want that…

user1169079
- 3,053
- 5
- 42
- 71
1
vote
2 answers
Calling native functions from Android Java - alternative to JNI
This might be a really rookie question, but I'm writing an Android app that needs to use a .so library written in C++. The .so is made up of several classes, and is in generic C++, not JNI.
Is there a way to call the C++ functions from the Android…

eskimo9
- 753
- 10
- 24
0
votes
1 answer
com.jniwrapper.win32.ie.Browser class is unable to render the agraphs and animation
I am using com.jniwrapper.win32.ie.Browser class for opening an URL in a JFrame. Url is opened but some report graphs are not rendered.
When I open the same URL in Internet Explorer, graphs are rendered properly. Please help me on this. Is there…
0
votes
0 answers
JNI received outer class this instead of inner class this in inner class method
I've two classes: OuterClass and InnerClass inside.
JNI received outer class this instead of inner class this in inner class method
public final class OuterClass {
static {
System.loadLibrary("jtest");
}
private native void…

PoltoS
- 1,232
- 1
- 12
- 32
0
votes
2 answers
thisObj in JNI function called from constructor refers to the class and not to the instance
I'm trying to implement a JNI library. I've noticed that thisObj passed to JNI function when called from a constructor differs from the same function called from a method.
Here is my minimal code:
public final class Test {
static {
…

PoltoS
- 1,232
- 1
- 12
- 32
0
votes
2 answers
expected `*mut jni::sys::_jobject`, found struct `jni::objects::JPrimitiveArray` error in Rust JNI call
I'm trying to call a rust library from java package and as part of that, i'm converting (serializing) an object before sending it over the wire.
How ever, I'm getting the following error.
expected `*mut jni::sys::_jobject`, found struct…

py_ios_dev
- 487
- 1
- 7
- 19
0
votes
0 answers
Build JNI Wrapper for C-Library with CMake
I am writing a Java wrapper for a C-Library that I own.
I build with CMake.
Here is my CMakeLists.txt file :
cmake_minimum_required(VERSION 3.4)
project(MyLib-java)
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
include(UseJava)
# JNI…

François Colas
- 163
- 7
0
votes
1 answer
Mapping pointer to UInt64
We are using jniwrapper to communicate from JAVA with a 3rd party DLL.
And the DLL wants us to pass the pointer to a callback function, as an uint64_t.
typedef struct random_struct {
...
uint64_t callback; //!< A function pointer to the…

Jack
- 11
- 3
0
votes
1 answer
How to call a Java function in JNI with custom class type argument
I'm trying to call a Java function from C++ with a custom class type argument. The issue is that the Java function gets garbage values when called from C++ (code shown below). If I use the argument of any other data type (String, float, int) the…

yabbasi
- 43
- 5
0
votes
1 answer
JAWT_LOCK_ERROR when trying to acquire lock from JAWT_DrawingSurface
Introduction
I'm using JNIWrapper, and the JAWT subcomponent of that library.
I'm trying to acquire the lock on a JAWT_DrawingSurface with the following code:
JAWT_DrawingSurface *ds = NULL;
ds = awt.GetDrawingSurface(env, comp);
dsLocked =…

karobar
- 1,250
- 8
- 30
- 61
0
votes
1 answer
JavaCPP error: cannot convert `char*` to `Abc*` for argument ‘1’ to `void testMyObject(Abc*)`
I have a simple cpp file with extern functions. One function returns the reference of class Abc and other one receives it and calls some method:
extern "C" {
void* getMyObject(int arg1, int arg2)
return new Abc();
}
void testMyObject(Abc* p)…

Nitin Trivedi
- 31
- 8
0
votes
0 answers
Calling Go Function from java using JNI: Library Not loaded
I am trying to call a go function from scala code using JNI . The function in question is as follows
//export Java_jniroute_TestJNI_printDisplay
func Java_jniroute_TestJNI_printDisplay(env *C.JNIEnv, obj C.jobject) {
size :=…

ankur jha
- 11
- 1
0
votes
2 answers
How to map Java ArrayList to C++ Vector> in JniWrapper?
I have an ArrayList of float arrays as ArrayList which I want to map to C++ Vector> in JniWrapper.
I followed this link:
"Returning an arraylist of string from Native java to JNI"
and made few changes to the code as per my…

Khubaib Ahmad
- 141
- 10
0
votes
0 answers
C++ and Java 64 bit migration challenges from 32 bit
Any set of guidelines or pointers to compile and run existing applications that use Java 32 bit version for linking native code in C++ and Java, as from Java9(JDK9) only 64 bit versions of java will be available.
Any ways to migrate JNI layer(32…

Makk
- 1