NOTE this is for B4J only (Erel has stated that you can't enable extension loading on Android/iOS - link)
Small Java library with two methods that enable or disable loading of extensions for SQLite.
You can get some precompiled extensions here.
github.com
Extensions must be in the same folder as your JAR (or Objects folder during debug) - alternatively (not tested) you can use the full path when calling load_extension. You must load the correct library for your OS (eg DLL for Windows and SO for Linux)
How to use;
Small Java library with two methods that enable or disable loading of extensions for SQLite.
- EnableLoading(SQL) - enable loading of SQLite extensions
- DisableLoading(SQL) - disable loading of SQLite extensions
You can get some precompiled extensions here.
GitHub - nalgeon/sqlean: The ultimate set of SQLite extensions
The ultimate set of SQLite extensions. Contribute to nalgeon/sqlean development by creating an account on GitHub.
Extensions must be in the same folder as your JAR (or Objects folder during debug) - alternatively (not tested) you can use the full path when calling load_extension. You must load the correct library for your OS (eg DLL for Windows and SO for Linux)
How to use;
B4X:
Dim SQL As SQL
SQL.InitializeSQLite(File.DirApp,"Test.sqlite",True)
Log(SQL.IsInitialized)
Dim e As EnableSQLiteExtensions
e.EnableLoading(SQL) ' Enable loading
SQL.ExecNonQuery("SELECT load_extension('crypto.dll')") ' Extension should be in the same folder as your JAR or Objects folder
e.DisableLoading(SQL) ' You can disable loading once you have loaded your extension
Log(SQL.ExecQuerySingleResult("select hex(crypto_md5('abc'));"))
Attachments
Last edited: