content: package com.revo.evabs;
  
  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.Toast;
  
  import com.google.android.gms.auth.api.signin.GoogleSignIn;
  import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
  import com.google.android.gms.auth.api.signin.GoogleSignInClient;
  import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
  import com.google.android.gms.common.SignInButton;
  import com.google.android.gms.common.api.ApiException;
  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;
  import com.google.firebase.auth.FirebaseUser;
  
  public class Login extends AppCompatActivity {
  
      private static final String TAG = "EVABS SIGN IN";
      SignInButton signInButton;
      GoogleSignInClient mGoogleSignInClient;
      int RC_SIGN_IN = 0;
      private FirebaseAuth mAuth;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_login);
  
          mAuth = FirebaseAuth.getInstance();
  
          signInButton = findViewById(R.id.sign_in_button);
          signInButton.setSize(SignInButton.SIZE_STANDARD);
          signInButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  switch (view.getId()) {
                      case R.id.sign_in_button:
                          signIn();
                          break;
                  }
              }
          });
  
          GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                  .requestProfile()
                  .build();
          mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
      }
  
      private void signIn() {
          Intent signInIntent = mGoogleSignInClient.getSignInIntent();
          startActivityForResult(signInIntent, RC_SIGN_IN);
      }
  
      @Override
      protected void onStart(){
          super.onStart();
          String email = "you@gmail.com";
          String password = "somepass";
          FirebaseUser currentUser = mAuth.getCurrentUser();
          updateUI(currentUser);
          if(currentUser != null){
              Intent challlist = new Intent(Login.this, ChallengeList.class);
              startActivity(challlist);
          }
  
          mAuth.createUserWithEmailAndPassword(email, password)
                  .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                      @Override
                      public void onComplete(@NonNull Task<AuthResult> task) {
                          if (task.isSuccessful()) {
                              // Sign in success, update UI with the signed-in user's information
                              Log.d(TAG, "createUserWithEmail:success");
                              FirebaseUser user = mAuth.getCurrentUser();
                              updateUI(user);
                          } else {
                              // If sign in fails, display a message to the user.
                              Log.w(TAG, "createUserWithEmail:failure", task.getException());
                              Toast.makeText(Login.this, "Authentication failed.",
                                      Toast.LENGTH_SHORT).show();
                              updateUI(null);
                          }
  
                          // ...
                      }
                  });
      }
  
      private void updateUI(FirebaseUser account) {
      }
  }
  