Join David Gassner for an in-depth discussion in this video Customizing marker info windows, part of Building Mobile Apps with Google Maps Android API v2.
As I described in the previous movie, the default info window will…display information that you feed into the marker through the marker options.…This info window has a title and a snippet.…The title is showing the locality of the…address, and the snippet is showing the country.…But you can create your own custom info windows, by…combining an XML layout file with a little bit of code.…In this version of the project…Custom Info Windows, I've already created an XML layout file.…
It's name Info Window, and it's in the layout folder under resources.…The XML layout file is just like a…layout file that you might create for an activity.…But it should be smaller, because it's only going…to take up a small amount of the screen.…The root layout should use wrap content for both the…width and the height to allow the info window to size itself automatically.…And then, you can combine image views, text views,…and other sorts of components, whatever you want to display.…
It's important to note that the info window is not interactive.…
Note: An Android device with Android 3.0 (Honeycomb) or higher, and that has Google Play Store installed, is required to use the course exercises. (Kindle Fire and Nook devices do not qualify.) Finished mapping apps can be deployed on Android 2.2 (Froyo) or later.
- Setting up the developer tools
- Adding required permissions
- Getting a Google Maps API key
- Importing and linking the Google Play services
- Setting a map's initial state
- Geocoding an address
- Getting the current location programmatically
- Adding map markers
- Handling marker events
- Drawing lines, polygons, and circles
- Adding maps to existing apps
Skill Level Intermediate
Q: In the Chapter 2 movie "Checking the device for the Google Play services APK," when I create my first Google Maps app, the app crashes when I call the custom method servicesOK(). The error in LogCat starts with: "java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value." How do I fix this?