I’m now working on Sample login application in which user can login with their username and password by pressing login button. If the user is new then he/she can also register by choosing username and password. And this registration part of application worked.
My actual question is: How do I compare the user entered credentials with the one that stored in database.
I used SELECT query to select the username and pwd as this
public void ValidateLogin(String un, String pwd)
{
SELECT_FROM = "SELECT u_name, u_pwd FROM" + table_name + "WHERE u_name == " + un + "AND u_pwd ==" + pwd;
db.execSQL(SELECT_FROM);
}
where username(un) and password(pwd) comes from another java file login.java.
Now please tell me how would I make a successful transition to viewprofile page after successful login?
1 Answer