0

I have a table in my database which contains a no of rows containing latitude, longitude and several other fields as columns.

I am making an SQLite search query to get all the rows which are within 500meter range.

but I don't know exactly how to put this query. I search a lot but still, I am confused.

this is the code which I am trying to search->

public void getNearby(Double lats, Double longs) {

    Cursor c1= sdb.rawQuery("SELECT * FROM owner0 WHERE'"+ acos(sin(lats) * 
 sin(Lat) + cos(longs) * cos(Lat) * cos(Lon - (-0.6981))) * 6371 <= .5+"'");

} This code is messed up with double quotes and single quotes. please help me with the correct format. here lats and longs are my current position and LAT and Lon are the fields in my database.

Thanks in advance.

madhan kumar
  • 1,560
  • 2
  • 26
  • 36
neens
  • 93
  • 7

0 Answers0