Default Google Map Activity for Android

This Activity code will provide basic functionality for including a Google Map using a SupportMapFragment.

The Google Maps V2 API includes an all-new way to load maps.

Activities now have to implement the OnMapReadyCallBack interface, which comes with a onMapReady() method override that is executed every time we run SupportMapFragment.getMapAsync(OnMapReadyCallback); and the call is successfully completed.
Maps use Markers, Polygons and PolyLines to show interactive information to the user.

MapsActivity.java:

Notice that the code above inflates a layout, which has a SupportMapFragment nested inside the container Layout, defined with an ID of R.id.map. The layout file is shown below:

activity_maps.xml

This is the Basic Google Map integration

Leave a Reply

Your email address will not be published. Required fields are marked *

seven + 11 =

Comment moderation is enabled. Your comment may take some time to appear.