I have a sqlite database that the user can register to! I have successfully created a login form and when the login is successful (username & password match the database's) the user is redirected to another activity. What i want is in the activity that the user is redirected,
to display his entire database row (id,username, books,email,course, password, student name)!! Any ideas?? I would really appreciate if you could help me as this is the final task to complete my final year project..I use Android Studio!! I have created staff like Adapters database helpers ans cursors
This is urgent!!!
Here is my database creation code:
static final String DATABASE_CREATE = "create table "+"LOGIN"+
"( " +"ID"+" integer primary key autoincrement,"+ "USERNAME varchar2," +
"PASSWORD varchar2, COURSE varchar2, EMAIL varchar2, STUDENT_NAME varchar2); ";
Here is how I store data in the database:
public void insertEntry(String userName,String password,String course,String email, String student_name)
{
ContentValues newValues = new ContentValues();
newValues.put("USERNAME", userName);
newValues.put("PASSWORD",password);
newValues.put("COURSE", course);
newValues.put("EMAIL",email);
newValues.put("STUDENT_NAME", student_name);
db.insert("LOGIN", null, newValues);
}
And finally here is the login that starts the new activity code:
if(password.equals(storedPassword))
{
Toast.makeText(MyActivity.this, "Congrats: Login Successfull", Toast.LENGTH_LONG).show();
dialog.dismiss();
startActivity(new Intent(MyActivity.this, Login_home.class));
}
else
{
Toast.makeText(MyActivity.this, "User Name or Password does not match", Toast.LENGTH_LONG).show();
}