How to implement search functionality for Google Map Api V2 Android?

13,118

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.
Share:
13,118

Related videos on Youtube

Alejandro Casanova
Author by

Alejandro Casanova

Graduated with honors and golden title in Computer Sciences in 2008. Vast experience in Android application development, using Internet, Maps, AdMob, GMA, GCM and games; counting more than 40 titles most of them still available in Google Play Store. Experience with .NET platform incuding ASP.NET MVC 5, WPF, WCF, Entity Framework and Prism. Also experience with Web Service development, SOAP and XML, Oracle and IBM platforms. Kknowledge Java, PHP, Symfony 1.x and 2.x and presentation web frameworks as Ext JS and JQuery. Six years of experience as university professor, 3 years as .NET developer, 8 years as Android Developer/Senior Android Developer with Java and Kotlin (1.5 years). Experience with Salesforce as administrator, Certified as Salesfrce Administrator and mobile app developer. Experience also with IOS and Swift.

Updated on May 26, 2022

Comments

  • Alejandro Casanova
    Alejandro Casanova almost 2 years

    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