title: how to search similar strings in SQLite
body: <p>I want to search table "TABLE_TOURS" for similar words of "query" in cloumn "COLUMN_TITLE" and return a list "List".
  helps me plzz</p>
  
  <pre><code>public List&lt;Tour&gt; getWordMatches(String query, String[] columns) {
      String selection =  ToursDBOpenHelper.COLUMN_TITLE + " MATCH ?";
      String[] selectionArgs = new String[] {query+"*"};
      return query(selection, selectionArgs, columns);
  }
  public List&lt;Tour&gt; query(String selection, String[] selectionArgs, String[] columns) {
      Log.i(LOGTAG, "getwordsmatches result"+ selection +" "+ selectionArgs);
      SQLiteQueryBuilder builder = new SQLiteQueryBuilder();
      builder.setTables(ToursDBOpenHelper.TABLE_TOURS);
  
      Cursor cursor = builder.query(dbhelper.getReadableDatabase(),
              columns, selection, selectionArgs, null, null, null);
      Log.i(LOGTAG, "cursor of db result "+ cursor);
      List&lt;Tour&gt; tours = cursorToList(cursor);
      Log.i(LOGTAG, "tours are "+ tours);
      if (cursor == null) {
          return null;
      } else if (!cursor.moveToFirst()) {
          cursor.close();
          return null;
      }
      return tours;
  }
  </code></pre>
  
  <p>and its cursorToList method:</p>
  
  <pre><code>private List&lt;Tour&gt; cursorToList(Cursor cursor) {
      List&lt;Tour&gt; tours = new ArrayList&lt;Tour&gt;();
      if (cursor.getCount() &gt; 0) {
          while (cursor.moveToNext()) {
              Tour tour = new Tour();
              tour.setId(cursor.getLong(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_ID)));
              tour.setTitle(cursor.getString(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_TITLE)));
              tour.setCate(cursor.getString(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_CATE)));
              tour.setDetail(cursor.getString(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_DETAIL)));
              tour.setDescription(cursor.getString(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_DESC)));
              tour.setImage(cursor.getString(cursor.getColumnIndex(ToursDBOpenHelper.COLUMN_IMAGE)));
              tours.add(tour);
          }
      }
      return tours;
  }
  </code></pre>