Adding a dummy domain at the end is a kind of patch and should be avoided. To include a username, follow these simple steps.
Sign up
Use the user ID, email address, and password during registration. Register your user using a regular email and password. If successful, save the letter against user_id in a separate node (branches).
mButtonSignUp.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(isValid()){ mProgressBar.setVisibility(View.VISIBLE); final String userId = mEditTextUserId.getText().toString(); final String emailId = mEditTextEmail.getText().toString() ; String password = mEditTextPassword.getText().toString() ; firebaseRef.createUser(emailId, password, new Firebase.ResultHandler() { @Override public void onSuccess() { firebaseRef.child("user_ids").child(userId).setValue(emailId); Toast.makeText(getBaseContext(),"You are successfully registered ",Toast.LENGTH_SHORT).show(); mProgressBar.setVisibility(View.GONE); } @Override public void onError(FirebaseError firebaseError) { mProgressBar.setVisibility(View.GONE); Toast.makeText(getBaseContext(),firebaseError.toString(),Toast.LENGTH_SHORT).show(); } }); } } });
Database
The database structure will look like this

entrance
Check if the user has entered an email address or user ID. If this is an email id, then log in directly with it, otherwise get the email id associated with the username and sign in.
Button buttonLogIn = (Button)findViewById(R.id.button_login); buttonLogIn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mProgressBar.setVisibility(View.VISIBLE); String username = mEditTextEmail.getText().toString() ; final String password = mEditTextPassWord.getText().toString() ; // Check if it is an email or not if(android.util.Patterns.EMAIL_ADDRESS.matcher(username).matches()) { performLogin(username,password); }else{ //get the emailId associated with the username firebaseRef.child("user_ids").child(username) .addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if(dataSnapshot!=null){ String userEmail = dataSnapshot.getValue(String.class); performLogin(userEmail,password); } } @Override public void onCancelled(FirebaseError firebaseError) { //Handle Error } }); } } });
private void performLogin(String emailId, String password) { firebaseRef.authWithPassword(emailId,password, new Firebase.AuthResultHandler() { @Override public void onAuthenticated(AuthData authData) { uid = authData.getUid() ; Toast.makeText(getBaseContext(), authData.toString(), Toast.LENGTH_SHORT).show(); } @Override public void onAuthenticationError(FirebaseError firebaseError) { Toast.makeText(getBaseContext(), firebaseError.toString(), Toast.LENGTH_SHORT).show(); } }); }