简体   繁体   中英

Save routes on Google Maps

I'm making an Android app and I want to save and store the route you do as long as you walk with your location enabled. I'm using google maps apiV2 and i want to know if it is possible or not. Thanks for your time!

It is possible. All you have to do is to store the coords every time the method onLocationChanged is called.

each time your onlocationchanged() listener is invoked you get a location and from that you can get the latlng and other information . you can either save the entire Location object into an arraylist or just the latlng .

in both ways you can achieve what you want .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM