I'm developing an app which use new google maps (see google play services and libs) and gps localization. In my app, I also have a SQLite db composed by a single table called POI(DOUBLE Latitute,DOUBLE Longitude,VARCHAR(45) POIName). At every new gps value (LatLng) i need to query the db to get the nearest POI. To do that i need to use this algorithm and wrote something of similar in sql. not difficult. right?
the real problem is: SQLite doesn't have cos, sin and acos functions. I tried to follow this answare using SQLite source code, Android NDK, Cygwin (I'm using W8) and my project... all togethers, reading the official doc, but with no result.
is there some good tutorial about this? or can someone explain me step-by-step how to do that?
[EDIT: more info] i created in my project a jni folder and i put inside: SQLite Source code; Android.mk.
Android.mk
#LOCAL_PATH is used to locate source files in the development tree.
#the macro my-dir provided by the build system, indicates the path of the current directory
LOCAL_PATH:=$(call my-dir)
#####################################################################
# build sqlite3 #
#####################################################################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/sqlite-amalgamation-3070900
LOCAL_MODULE:=sqlite3
LOCAL_SRC_FILES:=sqlite3.c
#include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
in cygwin I move to android-ndk-r8e folder and run this:
./ndk-build -C 'C:/Eclipse/Workspace/MyApp'