title: Highlight a specified route on Google Maps v2 Android
body: <p>Right, so I'm currently using the Google Directions API in my app to retrieve the route between two locations.</p>
  
  <p>When I send a request for a route directions, I retrieve a number of details in JSON regarding the route including the names of every road along the route, their corresponding start and end lat-long co-ordinates, and their polyline value.</p>
  
  <p>For example: If I send the request <a href="http://maps.googleapis.com/maps/api/directions/json?origin=redfern+ave,+dublin&amp;destination=limetree+ave,+dublin&amp;sensor=false" rel="noreferrer">http://maps.googleapis.com/maps/api/directions/json?origin=redfern+ave,+dublin&amp;destination=limetree+ave,+dublin&amp;sensor=false</a> between two roads, I get the following JSON response (output for one road along route).</p>
  
  <pre><code> {
                       "distance" : {
                          "text" : "0.2 km",
                          "value" : 203
                       },
                       "duration" : {
                          "text" : "1 min",
                          "value" : 18
                       },
                       "end_location" : {
                          "lat" : 53.435250,
                          "lng" : -6.132140000000001
                       },
                       "html_instructions" : "Head \u003cb\u003eeast\u003c/b\u003e on \u003cb\u003eRedfern Ave.\u003c/b\u003e toward \u003cb\u003eMartello Court\u003c/b\u003e",
                       **"polyline" : {
                          "points" : "woceIvgmd@O}DOkDQqF"**
                       },
  </code></pre>
  
  <p>So far my application parses this information and simply lists the roads and directions in a list view like this:</p>
  
  <p><img src="https://i.stack.imgur.com/No5zO.png" alt="enter image description here"></p>
  
  <p>What I want to do it highlight the whole route from A to B on a map, however I've found nothing useful online on how to do this on the new Google Maps API v2. I see that polyline's are used instead of overlays to draw lines on Google Maps v2, however from what I can tell, they only draw straight lines which is useless for me. Is there anyway of highlighting the route using the information I have at my disposal (road names, start &amp; end lat-long co-ordinates, polyline points? Any help is appreciated.</p>
  
  <p>Also, I see there is a 'polyline' value in the response which could be useful but I can't work out how to parse or use this bit of information. Does anyone know how I can make sense of this value to plot a polyline?</p>
  
  <pre><code>**"polyline" : {
               "points" : "woceIvgmd@O}DOkDQqF"**
  </code></pre>
  
  <p>EDIT: My solution code is provided in my answer below.</p>