22 #include <android/log.h>
26 #define LOG_TAG "libNative"
27 #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
28 #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
38 JNIEnv * env, jobject obj, jstring privateFile, jstring publicFile, jstring cacheFile);
45 FILE * file = fopen(fileName,
"r");
46 char * fileContent =(
char *) malloc(
sizeof(
char) *
size);
50 LOGE(
"Failure to load the file");
53 fread(fileContent, size, 1, file);
54 LOGI(
"%s",fileContent);
62 JNIEnv * env, jobject obj, jstring privateFile, jstring publicFile, jstring cacheFile )
64 const char* privateFileC = env->GetStringUTFChars(privateFile, NULL);
65 const char* publicFileC = env->GetStringUTFChars(publicFile, NULL);
66 const char* cacheFileC = env->GetStringUTFChars(cacheFile, NULL);
72 env->ReleaseStringUTFChars(privateFile, privateFileC);
73 env->ReleaseStringUTFChars(publicFile, publicFileC);
74 env->ReleaseStringUTFChars(cacheFile, cacheFileC);
static int PUBLIC_FILE_SIZE
static int CACHE_FILE_SIZE
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_fileloading_NativeLibrary_init(JNIEnv *env, jobject obj, jstring privateFile, jstring publicFile, jstring cacheFile)
static int PRIVATE_FILE_SIZE
GLenum GLuint GLintptr GLsizeiptr size
void readFile(const char *fileName, int size)