I'm trying to execute the following sqlite statement inside my android app:
String sql = "SELECT ID, lt, lg FROM Location WHERE ABS(lt-?) <= ? AND ABS(lg-?) <= ?";
I have tried using 'rawQuery' in the following sql statement:
String sql = "SELECT ID, lt, lg FROM Location WHERE ABS(lt-" + lt + ") <= " + ltGridLen + " AND ABS(lg-" + lg + ") <= " + lgGridLen + " LIMIT 1";
which worked. However, I want to know whether there is any other more efficient way to do this.