I have this structure in Firebase. And I need to capture all the latitudes and longitudes that are inside each key, I did a test and it is working if I for this data in a folder without the key it appears the marker on the map without problems, but only one, I want to capture and add all as markers on the map, how can I do it? with a for?
DatabaseReferenceref=FirebaseDatabase.getInstance().getReference();ref.child("uploads").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
double location_left = (dataSnapshot.child("latitude").getValue(Double.class));
double location_right = Double.valueOf(dataSnapshot.child("longitude").getValue(Double.class));
LatLng local = new LatLng(location_left, location_right);
mMap.addMarker(new MarkerOptions().position(local).title("Novo Marcador"));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(local, 18));
} else {
Log.i("MeuLOG", "erro na captura");
}
}