[mono-android] Java.Lang.Reflect?
Jeremy A. Kolb - ARA/NED
jkolb at ara.com
Mon Oct 15 15:30:44 UTC 2012
Nevermind I figured it out. This is how you enable the extension loading mechanism for Android's SQLite in Xamarin:
[DllImport("libsqlite.so")]
internal static extern int sqlite3_enable_load_extension(IntPtr sqliteDb, int onoff);
private IntPtr GetInternalDatabaseHandle(SQLiteDatabase db)
{
IntPtr fieldId = JNIEnv.GetFieldID(db.Class.Handle, "mNativeHandle", "I");
int handle = JNIEnv.GetIntField(db.Handle, fieldId);
return new IntPtr(handle);
}
...
IntPtr internalHandle = GetInternalDatabaseHandle(db);
int i = sqlite3_enable_load_extension(internalHandle, 1);
From: monodroid-bounces at lists.ximian.com [mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Jeremy A. Kolb - ARA/NED
Sent: Monday, October 15, 2012 11:03 AM
To: monodroid at lists.ximian.com
Subject: [mono-android] Java.Lang.Reflect?
I'm trying to follow the directions here: https://groups.google.com/forum/#!msg/spatialite-users/eDMvwrlF0oI/iXcPH0cLkRMJ but am unsure how to get at Java.Lang.Reflect or get the equivalent working in C#. Is this possible? I'm using pinvoke for the native code portion and in theory that will work but as far getting at the handle...
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20121015/316e28a4/attachment.html>
More information about the Monodroid
mailing list