How to implement the search feature for Google Map Api V2 Android?

advertisements

I need to implement a search functionality for my Android Google Map Api V2 project and can't find any working example. I just need to enter a city name, press a "Search" button and then the map should move to the city and show a marker on it. Just like the Google Maps application does. Autocompletion should be nice though. I actully get to show the map, show some markers, etc, I just can't get to perform the search and see the results. Please help!

Thanks in advance


I just need to enter a city name, press a "Search" button and then the map should move to the city and show a marker on it. Just like the Google Maps application does.

So for that you have to make the functionality on Click of search in which you have to do as follows:

  • The city name entered by the user Will be sent to the google api - It will get back the lat-long to you.
  • You will use that lat-long to add marker as well as,
  • You will use that lat-long to animate the Gmaps Camara. That's it.
  • In this way you are able to fullfill your above requirement.