Quick start with Firebase

Quick start with Firebase
15 June 2016 Pawel Cyron

Firebase helps you develop high-quality apps, grow your user base, and earn more money. This tutorial helps you to build your first project with it.

Why Firebase:

  • one app with one solution for everything
  • analytics module
  • simple DB and storage managment
  • credentials managment
  • crash reports
  • included cloud messaging funcionality
  • AdMob

firebaseOld structure required from us to create Server and Database for API.

0 traditional

Now Firebase gave us whole functionality in one place. What’s more. Its easy to configure and use.

0 firease

In this tutorial we will create simple project to show You how fast and convenient is to use Firebase.

1. Create empty Activity Android Project (or use existing one)

2. Setup Firebase

Go to Console and login with your google account.

Create new project.

1 , 5

On main screen select Add Firebase to your Android app.
1

Fill screen with information about your new application.

2

If You dont know how to retrive Your SHA1 key select root project in Android Studio, Click Gradle on the left panel , then double click signingReport in android section and wait until it finish. You will have your SHA1 in Run Window.

3

 

After submiting details about new Android app in Firebase, as in instruction shown, paste google-services.json into main app module directory and add dependencies.

Now our project is ready to go!

3. Signing with google credentials

Go to Console and choose Auth from left menu.

Click on €œset up sign in method€ and Enable Google sign in provider.

4

After process You should see in auth window
5

 

Now go back to Android Studio and add dependecies to app module

compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'

Go to our empty activity layout.

Add buttons to sing in and sing out as below.

6

Go to Activity and modify class as below.

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*