I am a beginner in android development and am trying to create a table in sqlite where the email value will be unique. However, the application is allowing you to register the same emails.
@Override
public void onCreate(SQLiteDatabase db) {
try {
String sql = "CREATE TABLE usuario (" +
"id INTEGER PRIMARY KEY NOT NULL," +
"email TEXT NOT NULL UNIQUE," +
"senha TEXT NOT NULL);";
db.execSQL(sql);
Toast.makeText(UsuarioRepository.this.contexto, "Tabela criada com sucesso", Toast.LENGTH_LONG).show();
}catch (SQLException ex){
Toast.makeText(UsuarioRepository.this.contexto, "Erro ao criar tabela: "+ex, Toast.LENGTH_LONG).show();
}
}