Giter Site home page Giter Site logo

firebase-login's Introduction

firebase-login

Login using Gmail and password

Note: This is not an application this is just an contraint. // 1 . Create a Firebase developer account at https://firebase.google.com/ and click on 'GO TO CONSOLE' // 2 . Click on 'Add project'. // 3 . Select the 'Android' platform SDK. // 4 . Open Android project. // Open the Gradle tab from a right side panel. // Double click on 'signingReport'. //. Sha-1 key is optional. build.gradle(Project)

dependencies {

classpath 'com.android.tools.build:gradle:3.0.1'  

classpath 'com.google.gms:google-services:4.0.1'  



// NOTE: Do not place your application dependencies here; they belong  

// in the individual module build.gradle files  

}

build.gradle (Module)

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
}
apply plugin: 'com.google.gms.google-services'

android mainfest.xml

 <uses-permission android:name="android.permission.INTERNET" />  

// on main activity.java

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(EmailPasswordActivity.this, "Authentication failed.",

                        Toast.LENGTH_SHORT).show();

                updateUI(null);

            }

            // ...

        }

    });

firebase-login's People

Contributors

john9500 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.