title: Checking username and password in Android using SQLite database
body: <p>I want to get query from SQLite Database in my APP that consist of name, surname, username and also password. </p>
  
  <h2>when I click login button, it made crash. here is my code ##</h2>
  
  <pre><code>public String Login(String Username, String Password) {
  
      String Q = "SELECT * FROM " + DBHelper.TBLname + " WHERE "
              + DBHelper.ColumnUser + " = " + Username
              + " AND " + DBHelper.ColumnPass + " = " + Password;
  
      Cursor LoginQuery = MyDB.rawQuery(Q, null);
  
      if (LoginQuery == null) {
          LoginQuery.close();
          String LoginResult = "Wrong User Name and Password";
          return LoginResult;
      }
          LoginQuery.moveToFirst();
          String LoginResult = LoginQuery.getString(3);
          LoginQuery.close();
      return LoginResult;
  }
  </code></pre>