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
Make sure to select Maps Activity while creating a new Project. To generate the API key for Maps you may refer to How to Generate API Key for Using Google Maps in Android. After generating your API key for Google Maps. We have to add this key to our Project.
There are tons of things that you can do with the Google Maps Android API. When you feel comfortable with the basics, feel free to get explore the API and add new functionality to your app. If you incorporated Android Wear into your MapPlayground app, then head on over to the next step to learn about the Google Maps API for Android Wear.
After generating your API key for Google Maps. We have to add this key to our Project. For adding this key in our app navigate to the values folder > google_maps_api.xml file and at line 23 you have to add your API key in the place of YOUR_API_KEY .
Google Map layouts for Android is based extensively on fragments. Instead of creating your own, the Google Maps API includes them with the majority of the backend done for you. As the developer, all you have to do is manage their lifecycle, layout, and interaction. I'll cover all of these topics below.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With