[Android Q&A, Help & Troubleshooting] theMedhi:
I am new to noSQL database systems. In this app, there are two types of users (Members and Admins) with two different UI. I am using firebase email authentication to register and validating users. Now, Members can register and log in to their respective interface. But how to define admins in firebase and send admins to their interfaces? Thanks

Member login:

package com.*******************;

import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

public class LoginActivity extends AppCompatActivity {

private EditText txtEmailLogin;
private EditText txtPasswordLogin;
private FirebaseAuth firebaseAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
txtEmailLogin= findViewById(R.id.etLoginEmail);
txtPasswordLogin= findViewById(R.id.etLoginPassword);
firebaseAuth=FirebaseAuth.getInstance();

}
public void btnLogin_Click(View v){
final ProgressDialog progressDialog=ProgressDialog.show(LoginActivity.this, "Please Wait...", "Processing...",true);

(firebaseAuth.signInWithEmailAndPassword(txtEmailLogin.getText().toString(), txtPasswordLogin.getText().toString()))
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressDialog.dismiss();

if (task.isSuccessful()){
Intent i=new Intent(LoginActivity.this, LastOrder.class);
startActivity(i);
}else{
//Log e("ERROR", task.getException().toString());
Toast.makeText(LoginActivity.this, task.getException().getMessage(),Toast.LENGTH_LONG).show();
}
}
});
}
public void registrationLink_Click(View v){
Intent i=new Intent(LoginActivity.this,RegistrationActivity.class);
startActivity(i);
}

}

Member registration:

package com.*******************;

import android.app.ProgressDialog;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

public class RegistrationActivity extends AppCompatActivity {

private EditText txtEmail;
private EditText txtPassword;
private EditText txtConfirmPassword;
private FirebaseAuth firebaseAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);

txtEmail = findViewById(R.id.etEmail);
txtPassword = findViewById(R.id.etPassword);
txtConfirmPassword=findViewById(R.id.etConfirmPassword);
firebaseAuth = FirebaseAuth.getInstance();

}

public void btnSubmit_Click(View v) {

final ProgressDialog progressDialog = ProgressDialog.show(RegistrationActivity.this, "Please Wait...", "Processing...", true);
(firebaseAuth.createUserWithEmailAndPassword(txtEmail.getText().toString(), txtPassword.getText().toString()))
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressDialog.dismiss();

if (task.isSuccessful()) {
Toast.makeText(RegistrationActivity.this, "Registration Successful", Toast.LENGTH_LONG).show();
Intent i = new Intent(RegistrationActivity.this, LoginActivity.class);
startActivity(i);

} else {
//Log e("ERROR", task.getException().toString());
Toast.makeText(RegistrationActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();

}
}

});

}

public void btnCancel_Click(View v){
Intent i=new Intent(RegistrationActivity.this, LoginActivity.class);
startActivity(i);
}
}