Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Google Maps in Android

  • Last Updated : 16 Jul, 2018

Maps are of great use and it increases the productivity of an app. Google Maps API allows Android developers to integrate Google Maps in their app.

Below is the step-by-step process to integrate Google Maps into Android applications:

  1. Goto and click on “GET STARTED” button as shown in the figure:
  2. Now select the Map checkbox and click on the Continue button as shown below:
  3. Select a project in which you want to enable Google Map API, and click on Next. A new key will be generated for the chosen project.
  4. Skip the Billing Process
  5. For integrating Google Map API, your machine’s SHA1 certificate is needed. So to find SHA1 certificate, follow below steps:
    • Open Command Prompt and go to your Java bin Folder
      cd C:\Program Files\Java\jdk1.8.0_91\bin
    • Give the following CMD command for getting Certificate Footprints:

      keytool -list -v -keystore “%USERPROFILE%\.android\debug.keystore” -alias androiddebugkey -storepass android -keypass android

  6. Go to
  7. In the API keys section, click on Pencil button made on the right of API key that you want to select, for attaching your app with.
  8. In Application Restrictions, select Android apps
  9. Click on Add package name and fingerprint
  10. Enter your app’s package name and the fingerprint which was found in above steps and click Save button.
  11. Insert the following in Project ->app ->src ->build.gradle ->dependencies
    compile ''
  12. Add the following declaration within the element of AndroidManifest.xml

        android:value="@integer/google_play_services_version" />
  13. Add the following permissions in Manifest.xml

            android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            android:name="android.permission.INTERNET" />
            android:name="android.permission.ACCESS_NETWORK_STATE" />
  14. Specify following specifications in Manifest.xml

  15. Add the following fragment code in ActivityMain.xml for adding Google map to your activity.

  16. Add the following code in

    public class MapsMarkerActivity extends AppCompatActivity implements OnMapReadyCallback {
        protected void onCreate(Bundle savedInstanceState)
            // Retrieve the content view that renders the map.
            // Get the SupportMapFragment and request notification
            // when the map is ready to be used.
            SupportMapFragment mapFragment = (SupportMapFragment)
        public void onMapReady(GoogleMap googleMap)
            // Add a marker in Sydney, Australia,
            // and move the map's camera to the same location.
            LatLng myPos = new LatLng(Location.getLatitude(), Location.getLongitude());
  17. Run the code.

    My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!