I have an application that gets the current position and the user selects a destination, these two starting locations, it queries Google: https://developers.google.com/maps/documentation/directions/
And get an xml with the places where I "turn" to reach the destination
After I read the xml, and trace a path between first and second point of the xml, and so on
Before the change of API, the path was perfect in the streets, but now appears like this image:
The code I use to draw:
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
super.draw(canvas, mapView, shadow);
Projection proj = mapView.getProjection();
Point ponto1, ponto2;
Path caminho = new Path();
for (int i = 0; i < geoPoints.size() - 1; i++) {
ponto1 = proj.toPixels(geoPoints.get(i), null);
ponto2 = proj.toPixels(geoPoints.get(i + 1), null);
caminho.moveTo(ponto2.x, ponto2.y);
caminho.lineTo(ponto1.x,ponto1.y);
canvas.drawPath(caminho, paint);
}
}