title: How to use Firebase Realtime Database for Android Google Map app?
body: <p>I'm trying to work on Firebase <code>Realtime Dataase</code> access to my map's Markers which includes <code>dob</code>, <code>dod</code>, <code>name</code>, <code>latitude</code> , <code>longitude</code>, etc. And I want to use Full name as the title of marker, as well as dob and dod for the snippet of marker. </p>
  
  <p>My problem is don't kown how to get the value of <code>latitude</code> , <code>longitude</code> as the position of Marker and also <code>firstname</code> and <code>lastname</code> as the title ...</p>
  
  <p>Here is my <code>Realtime Dataase</code></p>
  
  <p><code>Profile</code></p>
  
  <pre><code>0
  
  dob: "24/12/1940"
  
  dod: "02/07/2016"
  
  firstname:"Lincon"
  
  lastname:"Hall"
  
  latitude: -34.506081
  
  longitude:150.88104
  
  1
  
  dob: "05/06/1949"
  
  dod: "08/08/2016"
  
  firstname:"Ben"
  
  lastname:"Roberts"
  
  latitude:-34.50609
  
  longitude:150.8811
  </code></pre>
  
  <p>The code of my map app:</p>
  
  <pre><code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, OnMarkerClickListener {
  
      private Marker myMarker;
  FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
  DatabaseReference mProfileRef = firebaseDatabase.getReference();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_maps);
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  
  }
  
  @Override
  protected void onStart(){
      super.onStart();
  
      mProfileRef.child("Profile").addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(DataSnapshot dataSnapshot, String s) {
  
          }
  
          @Override
          public void onChildChanged(DataSnapshot dataSnapshot, String s) {
  
              for (DataSnapshot child : dataSnapshot.child("0").getChildren()){
                  String dob = child.child("dob").getValue().toString();
                  String dod = child.child("dod").getValue().toString();
  
                  String latitude = child.child("latitude").getValue().toString();
                  String longitude = child.child("longitude").getValue().toString();
  
                  String firstname = child.child("firstname").getValue().toString();
                  String lastname = child.child("lastname").getValue().toString();
  
                  LatLng location = new LatLng(latitude,longitude);
  
                  googleMap.addMarker(new MarkerOptions().position(location).title(firstname,lastname).snippet(dob,dod));
              }
  
          }
  
          @Override
          public void onChildRemoved(DataSnapshot dataSnapshot) {
  
          }
  
          @Override
          public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  
  }
  
  
  
  @Override
  public void onMapReady(GoogleMap googleMap) {
  
      googleMap.setOnMarkerClickListener(this);
  
      LatLng  wollongong = new LatLng(-34.404336, 150.881632);
      myMarker = googleMap.addMarker(new MarkerOptions()
              .position(wollongong)
              .title("Ben Roberts")
              .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))
              .snippet("05/06/1949 - 08/08/2016")
              .anchor(0.0f,1.0f )
  
      );
  
      LatLng  test2 = new LatLng(-34.404464, 150.881892);
      googleMap.addMarker(new MarkerOptions()
              .position(test2)
              .title("Graveyard")
              .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))
              .snippet("This is a test graveyard too")
              .anchor(0.0f,1.0f )
      );
  
      googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(wollongong, 18));
      googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
  
      if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
          return;
      }
      googleMap.setMyLocationEnabled(true);
  }
  
  @Override
  public boolean onMarkerClick(Marker marker) {
  
      if (marker.equals(myMarker))
      {
          Intent intent = new Intent(MapsActivity.this,Info_window.class);
          startActivity(intent);
      }
      else
      {
          Intent intent = new Intent(MapsActivity.this,Info_window.class);
          startActivity(intent);
      }
      return false;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Can anyone help me with that? Thanks a lot!</p>
  
  <p>The value of Dob and dod is null.</p>
  
  <p><a href="http://i.stack.imgur.com/bSMR4.jpg" rel="nofollow">map</a></p>