1) AndroidManifest.
xml (Inside application Tag)
<meta-data
android:name="[Link].API_KEY"
android:value="API KEY" />
2) [Link](Module :App) (inside dependancies)
implementation("[Link]:play-services-maps:18.2.0")
3) activity_main.xml
<fragment
android:id="@+id/map"
android:name="[Link]"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
4) [Link]
public class MainActivity extends AppCompatActivity implements OnMapReadyCallback {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
// Get the SupportMapFragment and request notification when the map is
ready
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager()
.findFragmentById([Link]);
[Link](this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney, Australia, and move the camera
LatLng sydney = new LatLng(-34, 151);
[Link](new MarkerOptions().position(sydney).title("Marker in
Sydney"));
[Link]([Link](sydney, 12));
}
}