title: Getting Data from Firebase realtime database, Android Studio, Java
body: <p>I am looking for a way to get data from the firebase real-time database in a format like an array[] or a String.</p>
  
  <p>My database looks like this:
  <a href="https://i.stack.imgur.com/u0G3D.png" rel="nofollow noreferrer">Link to image of database</a></p>
  
  <p>Or: 
  <code>Database
      |
       --&gt;Users
           |
            --&gt;UID1
            --&gt;UID2</code></p>
  
  <p>This is at the root of the database
  I want to get a list of all of the UIDs in the "Users" child.
  This is the code I have so far and am a bit stuck on:</p>
  
  <pre class="lang-j prettyprint-override"><code>DatabaseReference databaseReference = firebaseDatabase.getReference("Users");
          databaseReference.addValueEventListener(
                  new ValueEventListener() {
                      @Override
                      public void onDataChange(DataSnapshot dataSnapshot) {
                          String UIDs = dataSnapshot.getValue(String.class);
                      }
  
                      @Override
                      public void onCancelled(DatabaseError databaseError) {
                      }
                  });
  </code></pre>
  
  <p>I am a bit of a rookie as it comes to java, android studio, and firebase. I am trying to get the data in a format I know how to use like a String or an Array[] of Strings. I looked around if other people had maybe asked the same question, but I could get the answers to those questions to work/didn't understand them.
  Thanks in advance for your time!</p>