1

I am new to firebase. This is my database. How do i retrieve this data from firebase. This data is being added by the user so i dont know the number of incubators.

{
  Incubators :
            {
                Name_of_Incubator1
                { 
                      Contact : 3443354684
                      Founder : "Atul"
                      Email : "[email protected]"
                  }
                 Name_of_Incubator2
                { 
                      Contact : 3444569684
                      Founder : "Anupis"
                      Email : "[email protected]"
                  }
                 .
                 . 
                 .
                 .
           }
}

1 Answer 1

1

An example from Firebase Docs:

private DatabaseReference mDatabase;
// ...
mDatabase = FirebaseDatabase.getInstance().getReference();

ValueEventListener postListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
    // Get Post object and use the values to update the UI
    Post post = dataSnapshot.getValue(Post.class);
    // ...
}

@Override
public void onCancelled(DatabaseError databaseError) {
    // Getting Post failed, log a message
    Log.w(TAG, "loadPost:onCancelled", databaseError.toException());
    // ...
}
};
mDatabase.addValueEventListener(postListener);

You can try this sample project for starting up with Firebase : Friendly Chat

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.