to add a UDF in SQLlite/Android How to load extensions into SQLite? first sqlite3_enable_load_extension must be done to prevent from 'unauthorized access' I did in myfunc.c
#include <sqlite3.h>
#include <jni.h>
#include <stdlib.h>
jstring
Java_com_test_abc_SQLiteOpenHelper_enableExtension(JNIEnv* env, jobject thiz, sqlite3 *db)
{
sqlite3_enable_load_extension(db, 1); //errorline, without any infos
return (*env)->NewStringUTF(env, "enableExtension done");
}
java
package com.test.abc;
....
public class MyOpenHelper extends SQLiteOpenHelper {
...
@Override
public void onOpen(SQLiteDatabase db) {
super.onOpen(db);
enableExtension(db);
}
public native String enableExtension(SQLiteDatabase db);
}
without success. The JNI call from Java to C comes never back, without errorline it works. Has anyone a clue what is going wrong here? Best with code example.