i have stored the Data for my application in Firebase RealtimeDatabase. Now im facing a big problem by retrieving and writing the data to a csv file. My Database consists of two child nodes: The Model Color with different attributes like yellow, green, red.... and the child Times with different times. Both as String values represented.
For getting the data i have two queries. Everything works fine. But now i discovered that Firebase Queries work asynchron. And the only way to get the data written to the CSV File seems to be inside the onDataChange method from the EventListener.
I tried with interface but this does not solve the problem. (Like described here: Link to stackoverflow
I cant get the values from Firebase to be stored outside of the onDataChange method. I dont know how to split the buffered writer. At the moment its only possible for me to have one buffered writer and all the append.line stuff inside one of the queries. But this is not a solution. i need all data from both queries written to the file.
Does anybody know how to solve such a problem? (Im using java code)