I am searching for some way of using any Google API or android framework namespace, to get an optimized path between multiple locations.
For exemple, we have a few locations within the US : Los Angeles, New York, San Francisco, Washington, San Jose.
The order is quite bad, we arent going to go from LA to NY then back to SF and SJ.
Ive seen somewhere in the Google Maps API V3 some unofficial way of getting the optimized order.
Is there any possible way of doing so by using exclusively Java, and Android or Google API’s ?
Thanks a lot
Did you see that any Location has the Method distanceTo(Location)?
You could write a simple Comarator like this:
Not tested and the comparsion won’t return negative values, but it should work. You can then sort your Collection of Locations with