Creating custom function in sqlite3 in android

I need to add a custom function in sqlite3 in an android application to calculate the distance between two coordinates. I found a c function that can be added as a custom function in sqlite3.

I use NDK to compile sqlite3 files to create a .so file. But I donโ€™t know where to place the code for my user-defined function, which is also written in C and where to call sqlite3_create_function(...) , which attaches the user-defined function using sqlite, so I can use my user-defined function in sqlite queries.

+6
source share
1 answer

It seems that in general and for all purposes you cannot! but, there is a workaround if you can install your own sqlite How to create a custom function in SQLite?

0
source

Source: https://habr.com/ru/post/973806/


All Articles