android - Google direction and voice navigation -


i have been working on android project. came 2 question.

q1. how implement navigation drive ? logic , work - able draw path between 2 address. , thought that, use onlocationchanged(current) method call https://maps.googleapis.com/maps/api/directions/output?parameters current location , destination through method draw path on map. upon every onlocationchanged() method call, redraw path on map again. " how navigation ? "

q2. how implement voice navigation work q1 ? - did research, can't find seems helpful. know that, in return json /api/directions, there direction instruction in it. " use voice return json ? or there better way ? "

would helpful link or example in details. in adavnce

here know, hope helps out.

regarding first question:

after retrieving directions , necessary data, have draw direction once , once! yes, have use onlocationchanged() not redraw whole thing again.. if notice in of navigation application still keep main route, don't remove passed parts... have use onlocationchanged() check if user out of drawn path (by maybe 100m) have re-calculate , redraw again... redraw path every time user move costly operation better avoided...

for second question:

as said, data retrieved has navigation commands.. have create class map command voice.. , if notice within legs -> steps tags, there start , ending coordinates each sub-path, can use these data calculate distance between them on each 200m command "how far user turn left" example.

hope gives general idea of how works. luck , happy programming.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -