Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
455 views
in Technique[技术] by (71.8m points)

java - Sqlite on Android: How to create a sqlite dist db function - to be used in the app for distance calculation using lat, long

We are building an Android App that will use user's current location (lat, long) and show top 50 venues around the current location, sorted by distance.

We have these venues stored in an SQLite DB. We plan to ship with the sqlite DB with the app.

In order to fetch only the relevant top 50 closest venues, we want to define a db function DIST (to calculate distance between two points) and use it in our query.

How can I define a custom SQLite function for Android Apps? What will be the Java API call to do this?

We have successfully implemented this approach in our iPhone App - using Objective C.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Update: The answer is that you can not do this.

from: Android. Is it possible to write custom function on C/C++ and use it in SQL query?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...