title: Sqlite on Android: How to create a sqlite dist db function - to be used in the app for distance calculation using lat, long
body: <p>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.</p>
  
  <p>We have these venues stored in an SQLite DB. We plan to ship with the sqlite DB with the app.</p>
  
  <p>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.</p>
  
  <p><strong>How can I define a custom SQLite function for Android Apps? What will be the Java API call to do this?</strong></p>
  
  <p>We have successfully implemented this approach in our iPhone App - using Objective C.</p>