Posts

Showing posts from December 2, 2018

Realtime database using firebase - retrieving a specific information

Image
up vote 0 down vote favorite So I am trying to create a real-time multiplayer quiz. I am using the Google Real-time Multiplayer API together with the firebase real-time database. At the beginning of the game, users are prompted to ask themselves a question and provide two answers, where 1 answer is correct. Then this information is sent do Firebase Real-time Database under the child "Games" -- "mRoomId" --- "userId" The variable uniqueRoomID is the specific id of the room which they players are retrieving from the Google API. DatabaseReference myRef = database.getReference("Games").child(mRoomId).child(userId); And I send 4 values with the setValue function to that specific reference. Upload upload = new Upload(question,answer1,answer2, userId); myRef.setValue(upload); My data