I'm working on a android app which need to show nearby bus routes, I tried out the Google Place API and works. But it seems take too many time to load, what I did was:
1- create an asyncTaskLoader to request the following URI and get all the 'reference'
maps.googleapis.com/maps/api/place/search/json?sensor=false&radius=500&types=bus_station&location=-33.8670522,151.1957362&key=AIzaSyCLt9AhFhVnU-HZJyfWJeaWCMc7G1IbBnU
2- when step 1 finished, create N asyncTaskLoader(s) to request the following URI with N references received in step 1 to get the 'url'
maps.googleapis.com/maps/api/place/details/json?reference=reference_receive_from_step_1&sensor=false&key=AIzaSyCLt9AhFhVnU-HZJyfWJeaWCMc7G1IbBnU
3- when step 2 finished, create N asyncTaskLoader(s) to request the following URI and parse the DOM to get the routes showing in the page.
Thus, let's say we got 20 results in step 1, so we have 20 references, so we need to create 20 asyncTaskLoader(s) to get the url and 20 asyncTaskLoader(s) to get the routes. It seems that it is too complex and too many requests was made.
Is there another better solution? Thanks!