Polin-Rahman / Cloud_Firestore_Connection

Cloud Firestore Connection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloud_Firestore_Connection

Connect a new Android Studio project to Firebase with help of the Firebase assistant and add the Firestore dependency. When that’s done i upload my first document into my first collection, by retrieving the user input from 2 EditText fields, saving the input as strings in a HashMap together with their keys, and passing this HashMap to Firestore over a database reference that get with the static Firestore getInstance method. For this simply call the collection and document reference methods on Firestore reference, pass strings for their names and lastly call the set method to pass Map to this reference and set it as the fields on first document. Also add an OnSuccessListener and an OnFailureListener to have callbacks about the upload success.

Connection

  • Open a project on Firebase console

(My project name is "conect" on my console)

  • Select Datbase -> Cloud Firestore -> Creat database (in test mode)

  • For connection uith Firebase realtime Database in Android App (Android Studio) select Tools -> Firebase -> Analytics -> Log an analytics event

Then

Capture

Add dependencies [in build.gradle(Module: app)]

implementation 'com.google.firebase:firebase-core:16.0.4' (added automatically)

implementation 'com.google.firebase:firebase-firestore:21.4.1' (need to add manually)

Then "SyncNow" & complete the process.

API

minSdkVersion 22

targetSdkVersion 29

Database

conect_firestore

UI

conect

About

Cloud Firestore Connection


Languages

Language:Java 100.0%