How to get data from Real-Time Database in Firebase
<p>I've used the Real-Time Database with this setup:</p>

<pre><code>-&gt;users
    -&gt;uid
        -&gt;name
        -&gt;email
        -&gt;other info
</code></pre>

<p>If I wanted to save the user data I would use my User class and then set the object in the database like this:</p>

<pre><code>//assume variables have already been declared...

mFirebaseAuth = FirebaseAuth.getInstance();
mFirebaseUser = mFirebaseAuth.getCurrentUser();
User user = new User(name, email, other values...);
mDBRef.child("users").child(mFirebaseUser.getUid()).setValue(user);
</code></pre>

<p>I tried it and it works fine.</p>

<p>But how can I retrieve these values from the database? For instance, once I set a User object as shown above, I may want to retrieve the user's email. I don't mean getting the email through the sign-in provider. I want the email through the real-time database. I've tried working this out for a while now but the documentation isn't helping much. All it shows is to setup listeners in order to wait for changes to the data. But I'm not waiting for changes, I don't want a listener. I want to directly get the values in the database by using the keys in the JSON tree. Is this possible via the real-time database? If so, how can it be done because either the documentation doesn't explain it or I'm just not understanding it. If not possible, am I supposed to be using the Storage database or something else? Thanks.</p>