The easiest way is probably to do this outside of the database using this method in the Location<http://developer.android.com/reference/android/location/Location.html>class:
public float *distanceTo *(Location<http://developer.android.com/reference/android/location/Location.html>dest) Since: API Level 1<http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels> Returns the approximate distance in meters between this location and the given location. Distance is defined using the WGS84 ellipsoid. *Parameters* *dest* the destination location *Returns* - the approximate distance in meters On Monday, October 1, 2012 6:53:58 AM UTC-5, saex wrote: > > I must obtain a SQLite SQL Sentence for ordering by nearest latitude and > longitude coordinates, given a initial location. > > THis is a example sentence for my table in the sqlite database: > > SELECT id, name, lat, lng FROM items > > I must achieve this with SQLite, and with that table. I can't use another > techniques because this is for a existen SQlite database that i can't > change. > > Exists a way to achieve this with Android and SQlite? I checked a lot of > stackoverflow posts and i didn't find the way to achieve that > > Thanks > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

