We have covered in details how to use Android Cloud Firestore to create user login and registration system. You can read more about the post here.
Below is another way to add Cloud Firestore database in android project using Android Studio Assistant. Android Studio Firebase assistant downloads and add all the required dependencies and
google-service.json file to your project.
Android Cloud Firestore Database Setup Processes
1. Create a new android project.
2. Go to the tool menu in your Android Studio and select Firebase
3. Clicking on the Firebase menu item, a Firebase assistant window will open in the right side of Android Studio. Scroll down and select Cloud Firebase.
4. Click on the link Read and write document with Cloud Firestore. It will open a new content. Follow the instruction by first connecting your app to Firebase
5. If everything goes well, each step will be mark with green as show in the image above.
You can test your Cloud Firestore setup in your android project by add data to your database.
The following dependencies were added to gradle.build
implementation 'com.google.firebase:firebase-core:16.0.8' implementation 'com.google.firebase:firebase-firestore:18.2.0'
In addition to the dependencies, google-services.json plugin is also added
apply plugin: 'com.google.gms.google-services'
Finally, Android Studio makes it easier to add Cloud Firestore to Android Project. Like I mentioned before, if you want to add Firestore database manually, you can follow the link at the beginning of this tutorial.
Other Android Cloud Firestore Tutorials
- How to add Android Cloud Firestore Database to Android Project
- How to save document in Android Cloud Firestore Database