title: Android Firebase getReference and child
body: <p>what is reference and child in firebase ?</p>
  
  <pre><code>             mSearchedLocationReference = FirebaseDatabase
                  .getInstance()
                  .getReference()
                  .child(Constants.FIREBASE_CHILD_SEARCHED_LOCATION);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>            DatabaseReference restaurantRef = FirebaseDatabase
                  .getInstance()
                  .getReference(Constants.FIREBASE_CHILD_RESTAURANTS);
  </code></pre>
  
  <p>I took the code from <a href="https://www.learnhowtoprogram.com/android/data-persistence/firebase-writing-pojos" rel="nofollow noreferrer">https://www.learnhowtoprogram.com/android/data-persistence/firebase-writing-pojos</a> and from what i read :</p>
  
  <pre><code>Constants.FIREBASE_CHILD_RESTAURANTS = "Restaurants"
  Constants.FIREBASE_CHILD_SEARCHED_LOCATION = "SearchedLocation"
  </code></pre>
  
  <p>Restaurants and SearchedLocation both are a Node (or a Table in RDBMS perspective) , but why restaurant is called by reference and searchedLocation is called by child.  </p>
  
  <p>the other link which shows the searchedLocation child : <a href="https://www.learnhowtoprogram.com/android/data-persistence/firebase-reading-data-and-event-listeners" rel="nofollow noreferrer">https://www.learnhowtoprogram.com/android/data-persistence/firebase-reading-data-and-event-listeners</a></p>