title: Draw routes path based on my own markers in android Google maps v2
body: <p>I doing my android project about bus tracker in Uni campus. I need to draw a route from a bus stop to another bus stop and until back to origin bus stop.(There is about 20 bus stop in my Uni, need to draw route to let first user know the route of buses).</p>
  
  <p>I managed to draw a path by following this tutorial <a href="https://stackoverflow.com/questions/14710744/how-to-draw-road-directions-between-two-geocodes-in-android-google-map-v2">here</a></p>
  
  <p>In another tutorial , I found a blog which teaching draw path on google maps in 3 location. The sample code is</p>
  
  <pre><code>private static final LatLng LOWER_MANHATTAN = new LatLng(40.722543,-73.998585);
  private static final LatLng BROOKLYN_BRIDGE = new LatLng(40.7057, -73.9964);
  private static final LatLng WALL_STREET = new LatLng(40.7064, -74.0094);
  
  private String getMapsApiDirectionsUrl() {
      String waypoints = "waypoints=optimize:true|"
              + LOWER_MANHATTAN.latitude + "," + LOWER_MANHATTAN.longitude
              + "|" + "|" + BROOKLYN_BRIDGE.latitude + ","
              + BROOKLYN_BRIDGE.longitude + "|" + WALL_STREET.latitude + ","
              + WALL_STREET.longitude;
  
      String sensor = "sensor=false";
      String params = waypoints + "&amp;" + sensor;
      String output = "json";
      String url = "https://maps.googleapis.com/maps/api/directions/"
              + output + "?" + params;
      return url;
  }
  </code></pre>
  
  <p>but I got an error which are:</p>
  
  <pre><code>java.io.FileNotFoundException: https://maps.googleapis.com/maps/api/directions/json?waypoints=optimize:true|2.920114,101.775244||2.919726,101.771172|2.92234,101.769628&amp;sensor=false
  E/Background Task: java.lang.NullPointerException
  E/ParserTask: errororg.json.JSONException: End of input at character 0 of
  </code></pre>
  
  <p>The tutorial of the blog is same with the link. Just different in </p>
  
  <pre><code>String waypoints = "waypoints=optimize:true|"
              + LOWER_MANHATTAN.latitude + "," + LOWER_MANHATTAN.longitude
              + "|" + "|" + BROOKLYN_BRIDGE.latitude + ","
              + BROOKLYN_BRIDGE.longitude + "|" + WALL_STREET.latitude + ","
              + WALL_STREET.longitude;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>/ Origin of route
  String str_origin = "origin="+origin.latitude+","+origin.longitude;
  
  // Destination of route
  String str_dest = "destination="+dest.latitude+","+dest.longitude;
  </code></pre>
  
  <p>Can anyone give me some tutorial or guidance in draw path in multiple markes? Thank in advance!</p>