Marker

Source code in Map.zip

Click on each red Marker to display an InfoWindow. The Geocoder object in the markerFunction in the JavaScript program converts a street address ("233 Broadway") to a latitude and longitude. This is called geocoding. See Geocoding service.

  1. MainActivity.java
  2. activity_main.xml contains a WebView.
  3. map.html in the assets folder.
  4. AndroidManifest.xml: a WebView requires uses-permission INTERNET.

Create the project

Create the assets folder

The map.html to which the URL refers must be in the assets folder in the Android Studio project view. Select the app folder at the top of the left panel. Pull down
File → New… → Folder → Assets Folder
Finish

Remember to add the uses-permission to AndroidManifest.xml.

Create the map.html file

Select the assets folder in the left pane of Android Studio.
File → New… → File
Enter a new filename: map.html
OK