21 #include <android/log.h>
39 LOGE(
"ERROR - JavaClass: Environment cannot be NULL.\n");
45 LOGE(
"ERROR - JavaClass: Java class not found.");
68 LOGE(
"ERROR - JavaClass: Field %s not found in %s\n", fieldName,
classPath);
75 *result = returnValue;
81 if (!
intialized || fieldName == NULL)
return false;
85 LOGE(
"ERROR - JavaClass: Field %s not found in %s\n", fieldName,
classPath);
94 if (!
intialized || methodName == NULL || returnValue == NULL)
101 LOGE(
"ERROR - JavaClass: Method %s not found in %s.\n", methodName,
classPath);
105 if (javaReturn == NULL)
107 LOGE(
"ERROR - JavaClass: A call to static method %s in %s failed.\n", methodName,
classPath);
111 *returnValue = (
int*)
JNIEnvironment->GetIntArrayElements(javaReturn, ©);
112 if (*returnValue == NULL)
114 LOGE(
"ERROR - JavaClass: An attempt to retrieve array data in method %s in %s failed.\n", methodName,
classPath);
127 if (methodID == NULL)
129 LOGE(
"ERROR - JavaClass: Method %s not found in %s.\n", methodName,
classPath);
JavaClass(JNIEnv *JNIEnvironment, const char *classPath)
Constructor taking the Java environment and the required class path.
bool staticField(const char *fieldName, char **result)
Access a static String field of the Java class.
bool staticMethod(const char *methodName, int **returnValue, const char *param01)
Call a static method with one parameter which returns an integer array within the Java class...