Member Avatar

Hi, I have one function (in a library I can't change the code) which takes a key and returns a Object. This code is written in java. I am calling this function from cpp code. I am accepting the result as jobject. 1. Added key as "key1" & value as boolean true by calling a function. it saves in a map after converting in into java BooleanObject. 2. When I get it back I get it back as Object. I want to compare it with true now. How can I do that? Thanks in advance.

Member Avatar
+0 forum 2
Member Avatar

Hi, I have been working on JNI. I have one doubt. When I call any native method from android activity (Java code), then we get jclass object from jobject instance we get in the native method as a parameter. Why do we need it actually? Here is a snippet from one website: JNIEXPORT void JNICALL Java_TestJNIInstanceVariable_modifyInstanceVariable (JNIEnv *env, jobject thisObj) { // Get a reference to this object's class jclass thisClass = (*env)->GetObjectClass(env, thisObj); // int // Get the Field ID of the instance variables "number" jfieldID fidNumber = (*env)->GetFieldID(env, thisClass, "number", "I"); if (NULL == fidNumber) return; // Get …

+0 forum 0
Member Avatar

I strongly think this is a bug on Eclipse. The problem I have is explained in the image I attached so please take a look. I think I did the all settings correctly. ${NDKROOT}/platforms/android-9/arch-arm/usr/include in Paths and Symbols GNU C/C++ But I keep having "No such file" error when I try to include <android/asset_manager_jni.h>. The funny thing is #include <android/log.h> doesn't give me any error msg even though both files are in the same folder. The weird thing is that AAssetManager class becomes available even though it gives me "No such file" error. Can someone please tell me what is …

Member Avatar
+0 forum 2
Member Avatar

Hi, I am implementing an Android app using my old C++ classes. Everything looks okay but I have a wierd message which is : Invalid arguments ' Candidates are: void * malloc(?) ' The malloc code is written in a cpp file and <stdlib.h> is included properly but compiler does not recognize malloc :( What should I do?

Member Avatar
+0 forum 1
Member Avatar

I am trying to connect objective c application to Java.. I am relatively new to both.. Basically I would like Java application front-end which can call the objective - c app. I was thinking about first creating the obj c library in xcode and than wrap it in java somehow to get it called by my Java front end. somehow using JNI.. I am fuzzy on the specifics of the mechanisms... I was to get some advice from some of the experts out there... Any pointers to articles or books or code example are greatly appreciated..

Member Avatar
+0 forum 1
Member Avatar

Hi, I obtain the next error when I try debug the code and it is stoped. [QUOTE]ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820][/QUOTE] Can you help me, please? Thank you very much cordial greetings. stid

+0 forum 0
Member Avatar

Hi all, I've a curious problem with jni invocation. The explanation follows.. I have two pieces of code...a test stub, which is basically a stand alone java program and another the same code integrated into a component (the main function replaced by a static function). The code makes a jni method invocation by passing a few arguments. While the stand alone java program works fine, the component fails to invoke the jni method and hangs at the point of invocation. The interesting part is both of them are loading the same library. Yet one works and the other fails. Any …

+0 forum 0
Member Avatar

Hi all, I'm having trouble compiling a C++ project,which was originally written using the VC++, in Dev-C++. The problem is identifying the compiler errors that are incurred by the Min-Gw compiler(the default compiler that is shipped with Dev-C++) I've currently have converted the project(which is an opensource example of JNI) to the Dev-C++ project standard using the Dev-C++ IDE. But now when I try to compile it gives me 11 compiler errors. The 1st of of them is : [CODE] C\...\jni_resource.h `_resource' undeclared (first use this function) [/CODE] But the above variable '_resource' has already been declared in the header …

Member Avatar
+0 forum 1

The End.