title: Google direction API gives wrong distance and time duration
body: <p>I have implemented the google map api functionality in my android APP.
  The google map api give me a correct route(Directions), but it gives wrong distance and time between the two endpoint.</p>
  
  <p>I have implemented this google map api in android, in XML format.
  Following are the code that I have used to get the distance between two endpoint.
  (I am using the "Driving" mode). </p>
  
  <pre><code>public String getDistanceText(Document doc) {
          NodeList nl1 = doc.getElementsByTagName("distance");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "text"));
          Log.i("DistanceText", node2.getTextContent());
          return node2.getTextContent();
      }
  
      public int getDistanceValue(Document doc) {
          NodeList nl1 = doc.getElementsByTagName("distance");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "value"));
          Log.i("DistanceValue", node2.getTextContent());
          return Integer.parseInt(node2.getTextContent());
      } 
  </code></pre>
  
  <p>Following are the code to get the time duration between two end point:</p>
  
  <pre><code>public String getDurationText(Document doc) {
          NodeList nl1 = doc.getElementsByTagName("duration");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "text"));
          Log.i("DurationText", node2.getTextContent());
          return node2.getTextContent();
      }
  
      public int getDurationValue(Document doc) {
          NodeList nl1 = doc.getElementsByTagName("duration");
          Node node1 = nl1.item(0);
          NodeList nl2 = node1.getChildNodes();
          Node node2 = nl2.item(getNodeIndex(nl2, "value"));
          Log.i("DurationValue", node2.getTextContent());
          return Integer.parseInt(node2.getTextContent());
      }
  </code></pre>
  
  <p>What wrong I did here?</p>
  
  <p>Any help will appreciate. </p>