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: [email protected] 
[mailto:[email protected]] On Behalf Of Jeremy A. Kolb - 
ARA/NED
Sent: Monday, October 15, 2012 11:03 AM
To: [email protected]
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
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to