Gil Gil - 12 days ago 13
Android Question

What is the difference between ChildEventListener and ValueEventListener Firebase interfaces?

The documentation says they both listen to changes at a Firebase database location.

Answer

They do almost same thing, though ChildEventListener can be sometimes more flexible: with ChildEventListener you can specify different behavior for 4 actions (onChildAdded, onChildChanged, onChildMoved and onChildRemoved), while ValueEventListener provides only onDataChanged.

Also ChildEventListener provides DataSnapshots (immutable copies of the data) at child's location while ValueEventListener provides a DataSnapshot of a whole node.