hay all .. i have a customers table in my android database .. i am currently using room persistance, i am looking to take all my customers data .. but sequential from start location to nearest me at the moment .. how to query for it my case example .. My current latitude is -7.3530829 , my longitude is currently 112.6901788
data in my customers table
customers.address = "Waterpark Boulevard Citraland Area
customers.handphone1 = "0857887328"
customers.latitude = -7.2864881
customers.longitude = 112.6525076
data in my customers table
customers.address = "Nature Conservation Area
customers.handphone1 = "0857887328"
customers.latitude = -7.3571553
customers.longitude = 112.6862058
data in my customers table
customers.address = "Kawasan Taman Pinang
customers.handphone1 = "0857887328"
customers.latitude =
-7.3403807
customers.longitude = 112.6914085
//get Data by Name,,
@Query("SELECT * FROM customers WHERE name = :name")
abstract fun findByName(name:String): MutableList<Customers>
//How to retrieve data based on the closest distance ?
@Query("SELECT ???")
abstract fun findByDistance(mylatitude:Double,mylongitude:Double): MutableList<Customers>
please help to findByDistance query ..