title: Firebase login and signup with username
body: <p>I am currently using AndroidHive's <a href="http://www.androidhive.info/2016/06/android-getting-started-firebase-simple-login-registration-auth/" rel="nofollow noreferrer">tutorial</a> to learn how to use Firebase, I am starting to understand the methods and documentation well now - I realised that Firebase offers a signup/sign-in method with email and password, and that this piece of information is not stored in our database.</p>
  
  <p>I would like to implement a system where when they sign up they provide their email,password and a username along with some other data and it all gets saved to the database. So that the user can then signin with their email or username. I found this article on stack which apparently is the <a href="https://stackoverflow.com/questions/32151178/how-do-you-include-a-username-when-storing-email-and-password-using-firebase-ba">answer</a> to this question I am asking - However, I do not fully understand this and how it links with my code below</p>
  
  <pre><code>auth.createUserWithEmailAndPassword(email, password)
  .addOnCompleteListener(SignupActivity.this, new OnCompleteListener&lt;AuthResult&gt;() {
  @Override
  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
      Toast.makeText(SignupActivity.this, "createUserWithEmail:onComplete:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
      progressBar.setVisibility(View.GONE);
  
      if (!task.isSuccessful()) {
          Toast.makeText(SignupActivity.this, "Authentication failed." + task.getException(),
              Toast.LENGTH_SHORT).show();
      } else {
          startActivity(new Intent(SignupActivity.this, MainActivity.class));
          finish();
      }
  }
  });
  </code></pre>
  
  <p>Any help is much appreciated thanks</p>