GithubHelp home page GithubHelp logo

harika-jetti-'s Introduction

Authentication using firebase.

step1: Create a firebase account. step2: Open a new project in android studio. step3: Add firebase to the app. Create a JSON file. step4: Use the Firebase Assistant

To open the Firebase Assistant in Android Studio:

Click Tools > Firebase to open the Assistant window. Click to expand one of the listed features i.e., authentication, then click the provided tutorial link. Click the Connect to Firebase button to connect to Firebase and add the necessary code to your app. First, add rules to your root-level build.gradle file, to include the google-services plugin:

  • buildscript { // ...   dependencies {   // ...   classpath 'com.google.gms:google-services:3.0.0'   } }

Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin:

  • apply plugin: 'com.android.application'

    android { // ... }

    dependencies { // ... compile 'com.google.firebase:firebase-core:10.2.1'

    // Getting a "Could not find" error? Make sure you have // the latest Google Repository in the Android SDK manager }

    // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'

Step:5 we need to enable the settings in console.

email and password must be enabled in firebase console.

Step:6 declare firebaseauth and authstatelistener as objects step 7: in the oncreate method initialize the instance to track whenever the user signs in and sign out. Step 8: Attach the listener to your FirebaseAuth instance in the onStart() method and remove it on onStop()

Sign up to new users Create a new createAccount method which takes in an email address and password, validates them and then creates a new user with the createUserWithEmailAndPassword method.

step 9: Add a form to register new users with their email and password and call this new method when it is submitted.

sign in existing users

step 10: Create a new signIn method which takes in an email address and password, validates them, and then signs a user in with the signInWithEmailAndPassword method.

step 11: Add a form to sign in users with their email and password and call this new method when it is submitted.

Access user information

step 12: If a user has signed in successfully you can get their account data at any point with the getCurrentUser method.

harika-jetti-'s People

Contributors

harikajetti avatar

Watchers

James Cloos avatar  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.