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.
- one app with one solution for everything
- analytics module
- simple DB and storage managment
- credentials managment
- crash reports
- included cloud messaging funcionality
Now Firebase gave us whole functionality in one place. What’s more. Its easy to configure and use.
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.
Fill screen with information about your new application.
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.
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.
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.
Go to Activity and modify class as below.