title: Android Studio search existing sqlite db
body: <p>So im developing an app and I want the user to search for a food item in my database and then to be returned with a list view of all food names that match the search criteria. I already have my slqite database created and added to the assets folder. The database is called <strong>foodDatabase.db</strong></p>
  
  <p>I have created the Database Helper like so:</p>
  
  <pre><code>package com.example.codebind.databasedemo;
  
  import android.content.Context;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  
  /**
   * Created by tom on 15/03/2018.
   */
  
  public class FoodDatabaseHelper extends SQLiteOpenHelper{
      public static final String DATABASE_NAME = "FoodDatabase.db";
      public static final String TABLE_NAME = "dataset";
      public static final String COL_1 = "ID";
      public static final String COL_2 = "Food";
      public static final String COL_3 = "Description";
      public static final String COL_4 = "Protein";
      public static final String COL_5 = "Fat";
      public static final String COL_6 = "Carbohydrate";
      public static final String COL_7 = "Energy";
      public static final String COL_8 = "Starch";
      public static final String COL_9 = "Sugar";
      public static final String COL_10 = "Cholesterol";
  
      public FoodDatabaseHelper(Context context) {
          super(context, DATABASE_NAME, null, 1);
          SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
      }
  
      @Override
      public void onCreate(SQLiteDatabase sqLiteDatabase) {
          sqLiteDatabase.execSQL("create table " + TABLE_NAME +" (ID INTEGER 
  PRIMARY KEY AUTOINCREMENT,FOOD TEXT,DESCRIPTION TEXT,PROTEIN BLOB,FAT 
  BLOB,CARBOHYDRATE BLOB,ENERGY BLOB,STARCH BLOB,SUGAR BLOB,CHOLESTEROL BLOB) 
  ");
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
          sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " +TABLE_NAME);
          onCreate(sqLiteDatabase);
      }
  }
  </code></pre>
  
  <p>and currently my MainActivity.java is clean. I haven't touched it yet.</p>
  
  <p>I'm asking for guidance on how to add a listener so that when the user enters a food name the app will return all foods from the foodDatabase.db that meets the search query.</p>
  
  <p>Thanks</p>