I have a simple android application that I created using xamarin. I want to retrieve information from a specific location in my data base whenever a user press a certain button. I'm using the real time database. Is this possible?
I searched online for a few hours but I only found information about how to retrieve data when the data changes, I just need to retrieve it when a button is pressed.
![The structure of my database for context][1]
I want to retrieve the strings from a specific ID when a user presses a certain button. How do I retrieve the strings?
EDIT: I followed the advice of one of the comments that provided me with a java code, I'm trying to create a c# equivalent that i can use in xamarin, this is what I have so far:
btnSearch.Click += async (sender, e) =>
{
DatabaseReference dbref = AppDataHelper.GetDatabase().GetReference("trip");
dbref.ValueChanged += HandleValueChanged;
void HandleValueChanged(object sender, ValueChangedEventArgs args)
{
if (args.DatabaseError != null)
{
System.Diagnostics.Debug.WriteLine(args.DatabaseError.Message);
return;
}
}
};
ValueChanged and ValueChangedEventArgs aren't recognized, what should I do? [1]: https://i.stack.imgur.com/MrSDt.jpg