Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. mAuth.createUserWithEmailAndPassword(userId + "@gmail.com", userPw)
  2. .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  3. @Override
  4. public void onComplete(@NonNull Task<AuthResult> task) {
  5. if (task.isSuccessful()) {
  6. // Sign in success, update UI with the signed-in user's information
  7. Log.d("signup: ", "createUserWithEmail:success");
  8. FirebaseUser user = mAuth.getCurrentUser();
  9. // updateUI(user);
  10. } else {
  11. // If sign in fails, display a message to the user.
  12. Log.w("signup: ", "createUserWithEmail:failure", task.getException());
  13. Toast.makeText(view.getContext(), "Authentication failed.",
  14. Toast.LENGTH_SHORT).show();
  15. // updateUI(null);
  16. }
  17. // ...
  18. }
  19. });
  20.  
  21. apply plugin: 'com.android.application'
  22.  
  23. android {
  24. compileSdkVersion 28
  25. defaultConfig {
  26. applicationId "xxx.xx.xxx"
  27. minSdkVersion 19
  28. targetSdkVersion 28
  29. versionCode 1
  30. versionName "1.0"
  31. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  32. vectorDrawables.useSupportLibrary = true
  33. }
  34. buildTypes {
  35. release {
  36. minifyEnabled false
  37. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  38. }
  39. }
  40. }
  41.  
  42. dependencies {
  43. implementation fileTree(dir: 'libs', include: ['*.jar'])
  44. implementation 'androidx.appcompat:appcompat:1.0.2'
  45. implementation 'com.google.android.material:material:1.0.0'
  46. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  47. implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
  48. implementation 'androidx.annotation:annotation:1.0.2'
  49. implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
  50. testImplementation 'junit:junit:4.12'
  51. androidTestImplementation 'androidx.test:runner:1.1.1'
  52. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  53. implementation 'com.google.firebase:firebase-core:16.0.8'
  54. implementation 'com.google.firebase:firebase-auth:16.2.1'
  55. implementation 'androidx.fragment:fragment:1.0.0'
  56. }
  57.  
  58. apply plugin: 'com.google.gms.google-services'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement