I need an Android app, consisting of one activity only. It should have a text input, where you can enter the address. Then you click a button and it sends the address together with your coordinates (GPS) to Google Directions API. The API will return steps (directions) in xml format. So far the task is trivial, however, I need the app to display (in text) instructions as of where to go. Simply displaying instructions from the received xml is not enough. For example, imagine I am facing the opposite direction and move forward. The app should display turn around (or turn 180 degrees) and move forward for so and so meters. If I then deviate from the path to the left for, let us say, more than 30 degrees, it should display "you should turn 30 degrees to the right and keep going for so and so meters".
The suggested algorithm is:
1) Find your direction (vector)
2) Find the vector from your position to the next "end_location"
3) You can find the angle by cross product.
4) If the arcsin of the cross product is 0 or within acceptable 5 degrees and pointing in the same direction everything is fine, just display "go forward for x meters"
5) else display "you are deviating from the path. turn x degrees to the left/right"
The app should constantly (or every 3 seconds) compare it is gps coordinates to the next "end_location" from the api. The "end_location" is given in longitude and latitude and, probably, will have to be converted to a vector first.
The general idea is, a person should be able to follow google directions without the map itself.
I have included a document which further clarifies what I need.