good day, here is my firebase real-time structure Here is my java code The above code is the sample of my class which i used in reading the logged user data with its firebaseUser.getUid() Question. How can i read all the User data all together without having to provide or use firebaseUser.getUid() in the child method ? Thanks. Answer By
Tag: firebase
Get the named of Collections from Document on Cloud Firestore
I want to get collections (Col01, Col02, Col03) from the document (Doc01). How can I approach this? Check the attached image. Thanks. Answer There is no API for getting a list of collection names that exist within your (Doc01) document. So, unfortunately, you cannot do that on Android. Because you are looking for sub-collections that are nested under a document,
Android studio – Java Null-pointer on Firebase invocation
The actual error I receive when running the program is: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.google.firebase.database.DatabaseReference com.google.firebase.database.DatabaseReference.child(java.lang.String)’ on a null object reference This is my firebase database class: This is my main class: I’ve attempted different solutions but I still receive nullPointerException for the database. How could I properly initialize the database for access? I would really appreciate the
How to retrieve arrays from FirebaseFirestore using Collections?
This is my Firestore database Now here I want to retrieve Description and No. of Options which is saved in the form of an array, my code above prints other details of the data as well, with respect to the topic name selected hence I’ve used whereEqualTo(“Topic Name”, message)as my query(where the message is the topic I select). How to
Android Cloud Firestore document fields query
How to query all timestamps for a certain date (20210205) and certain user (ala) from Cloud Firestore in the below example? For now, I can download the entire document and filter it on the device. But it’s not effective. Answer You can filter for FieldPath.documentId() as shown here to get the ala document in a query. But as you commented
What is the difference between get() and addListenerForSingleValueEvent?
I see a lot of tutorials, documentation and questions about using the Firebase Realtime Database on Android talk about the addListenerForSingleValueEvent method. This method reads the value from the database once, which is what I want to do. But in the auto-complete in my IDE and in the documentation I also see a method called get(), which also seems to
Why counter just increase to 1 in firebase?
im trying to increase a visitor counter views when access to read a message, so i made a method called incrementar () and set it where i retrieve info when someone click to open that post. But i dont know why only increase to 1 view in firebase, if i click again it does not increase. should use shared preferences?
Is firestore callback method run in a separate thread?
I am fetching Firestore data through RX observable. Is it required to subscribe to it in a separate thread or Firestore callback run off the main thread by default? Also please share any references regarding the Firestore unit test. Answer Is it required to subscribe to it in a separate thread or Firestore callback run off the main thread by
Firebase Storage Code: -13000 HttpResult: 0
When I try to upload an image to the storage I get this error : I have already tried changing the dependencies and the versions but nothing has changed. I have also tried several times to modify my …
Select next value firebase android
I’d like to get first register and then the second one when user click in next button, and so on… I have this: and this: My firebase is: So when user open the activity I’d like to show the first value and when he clicks in button I’d like to show the second and so on. Any ideas how to