Hello i am using dynamodb and i want to know how do i maintain a session when the user logs in.
Following is my login code
Runnable runnable = new Runnable() {
public void run() {
Users user = mapper.load(Users.class,username);
System.out.println(user.getPassword());
System.out.println(username);
if (user != null && user.getPassword().equals(password)){
//System.out.println("Correct");
runOnUiThread(new Runnable() {
@Override
public void run() {
setContentView(R.layout.activity_account);
}
});
}
and this is my user class where i set and get all entities
public class Users {
private String id;
private String email;
private String username;
private String password;
private String role;
@DynamoDBHashKey(attributeName = "id")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@DynamoDBAttribute(attributeName = "email")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
same goes for all other variables as well.
Please look at these codes and tell me how i could store sessions as i want the id of the logged in user.