We are specifying the name for this fragment as Support Map Fragment. Įxplanation − In the above code we are creating a fragment in which we will be displaying the Google Map inside our application. Comments are added in the code to get to know in detail. In the left pane navigate to app>res>layout>activity_maps.xml to open this file. Note − Make sure to add your api key which you have generated in place of Enter your API key tag. Navigate to app>AndroidManifest.xml file and add below code to it. Now as we have generated google maps api key we have to use this key in our project’s AndroidManifest.xml file. Step 3 : Working with AndroidManifest.xml file Go to this URLbelow in which you will find a detailed documentation on How to create a Google Maps API key which we have to add in our application to display Google Maps. Step 2 : Creating an API key to display Google Maps Once our project has been created we will get to see 2 files which are open i.e activity_maps.xml and MapsActivity.java file. Note − Make sure to select the Language as Java.Īfter specifying all the details click on Finish to create a new Android studio project. Then the package name will be generated automatically. Inside this screen we have to simply specify the project name. After clicking on next you will get to see the screen below. Inside this screen we have to simply select Google Maps Activity and click on Next. ![]() In the below screen click on New Project to create a new Android Studio Project.Īfter clicking on New Project you will get to see the below screen. Navigate to Android studio as shown in below screen. Step 1 : Creating a new project in Android Studio Now let's move towards android studio for creating a new project. We will be following a step by step guide for building this application. We will be creating a simple application in which we will be displaying a simple Google Map within our application and we will be adding a marker on that map to the Delhi location. ![]() In this article we will take a look on How to run Google Maps v2 on the android emulator. For example we use many food delivery applications in which we can get to see our order status along with the location of the delivery boy on Google Maps. Many android applications nowadays use Google Maps within it to display the map to the users.
0 Comments
Leave a Reply. |