Android Listview using Google maps

An application to create an android. Initially, I show a list with some cities. When you click on any city, it displays a map related to this city.

Now I am suffering from how to connect the selected city from the list using the idea googlemap.any, please let me know.

+4
source share
3 answers

You simply make a list of city objects. Each object will contain the name of the city and location (latitude, longitude). When you click an item, go to map activity by passing the location in the Intent. In map activity, you analyze the location and tell the map to go to that point.

+2
source

First, U has, for example, a database (or a local data structure in your list activity) with cities and corresponding coordinates. Then in onListItemClick() you create a new intent and insert additional data (name, coordinates or primary key of the row in the db table) into it. Start a new activity with extended MapActivity with this intention, take mMapController = mMapView.getController(); and animate to mMapController.animateTo(new GeoPoint((int)yourLatitudeE6,(int)yourLongitudeE6)) , where yourLatitudeE6 and yourLongitudeE6 are additions from intent

0
source

I think you should have a lat and a long city. Therefore, you can send this lat and search for a map through the bundle for a long time and fill out a map of this city. In this link you can get a complete tutorial for mapview. http://www.vogella.com/articles/AndroidGoogleMaps/article.html

0
source

All Articles