My Database Structure is: In this structure, I need to get “ID” (which is autogenerated) as “ovxZPZeyy2VlZUP1K0vv9VtiThu1” if the “UserName” matches to “GokulNew1”. And I need to store the ID in String ID. And My Code is, Answer To get the key of the node (ovxZPZeyy2VlZUP1K0vv9VtiThu1) if the “UserName” matches to “GokulNew1”, please use the following lines of code: The
Tag: firebase-realtime-database
I want cumulative of production qty which I saved in key value ‘pqty’ in firebase?
I want cumulative of production qty in key ‘pqty’ property: I tried this and got output as 0. But I want output as 750. I’m using sketch ware. Answer First of all, you are storing the “pqty” property in your database as a String and not as a number, which in my opinion is a really bad idea. If your
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?
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
snapshot.getValue(User.class) is returning null
I was working on this User information project. I have created login registration for users. The project supposed to show information about logged-in users. When users log in to their profile, it is returning a null reference. Answer The key of the user node that is showing in your JSON (-MRF…J0KL) was generated by calling push() in a DatabaseReference. It
how I can get data from the firebase database without repeat
I am developing a android app work with the firebase database , when the user add item to the database the app display it at the Realtime and that what I want , but the problem it is that same item show more than one time in the RecyclerView this is the code that I try But it does not
How to filter data in FirebaseRecyclerOptions by spinner?
I’m using Firebase Database to show data in RecyclerView. Now I want to add a filter option by using an Android spinner. When I try to use different queries code doesn’t work. How can I use the spinner to show data for only 1 query and refresh this by changing the spinner item? This code now works without a spinner
Show data from Firebase in Recyclerview, filtered on username – How to?
With the following line of code I’m able to show the data under “results” of the User “Hendrik”. But what I want, is to show the data under “results” according to which user is logged in. I think I’m supposed to work with FirebaseAuth to check which user is currently logged in? I’m not really sure tho, anyone has any
Put firebase data in a JTable
I am struggling to put some firebase data into a jtable in java swing. As seen in photo I’ve been able to retrieve the data from firebase but for some reason the data won’t be displayed in the JTable field(table1) I looks like the getID(), getName()… methods didn’t get any value, since I tried to print row[i] to see if