June 2018
Beginner to intermediate
394 pages
9h 2m
English
To read the object data from Firebase Realtime ValueEventListner() whenever there is an update in the database in onDatachanged callback we can read the data changes:
mDbRef.child(userId).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { Users user = dataSnapshot.getValue(Users.class); Log.d(TAG, "User name: " + user.getName() + ", email " + user.getEmail()); } @Override public void onCancelled(DatabaseError error) { // Failed to read value Log.w(TAG, "Failed to read value.", error.toException()); }});
When the code is executed, it will result in fetching the data tree to your project. It is up to us how we make use of the data.
Since we are ...
Read now
Unlock full access