You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/quick-android-map.md
+33-19Lines changed: 33 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ This article shows you how to add the Azure Maps to an Android app. It walks you
24
24
25
25
## Prerequisites
26
26
27
-
1. A subscription to [Microsoft Azure](https://azure.microsoft.com). If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
27
+
1. A subscription to [Microsoft Azure]. If you don't have an Azure subscription, [create a free account] before you begin.
28
28
29
-
1.[Android Studio](https://developer.android.com/studio/). If you don't have Android Studio, you can get it for free from Google.
29
+
1.[Android Studio]. If you don't have Android Studio, you can get it for free from Google.
30
30
31
31
> [!NOTE]
32
32
> Many of the instructions in this quickstart were created using Android Studio Arctic Fox (2020.3.1). If you use a different version of Android Studio, the steps specific to Android Studio may vary.
@@ -35,7 +35,7 @@ This article shows you how to add the Azure Maps to an Android app. It walks you
35
35
36
36
Create a new Azure Maps account using the following steps:
37
37
38
-
1. In the upper left-hand corner of the [Azure portal](https://portal.azure.com), select **Create a resource**.
38
+
1. In the upper left-hand corner of the [Azure portal], select **Create a resource**.
39
39
2. In the *Search the Marketplace* box, type **Azure Maps**, then select **Azure Maps** from the search results.
40
40
3. Select the **Create** button.
41
41
4. On the **Create Maps Account** page, enter the following values:
@@ -58,7 +58,7 @@ Once your Azure Maps account is successfully created, retrieve the subscription
58
58
3. Copy the **Primary Key** and save it locally to use later in this tutorial.
59
59
60
60
>[!NOTE]
61
-
> For security purposes, it is recommended that you rotate between your primary and secondary keys. To rotate keys, update your app to use the secondary key, deploy, then press the cycle/refresh button beside the primary key to generate a new primary key. The old primary key will be disabled. For more information on key rotation, see [Set up Azure Key Vault with key rotation and auditing](../key-vault/secrets/tutorial-rotation-dual.md)
61
+
> For security purposes, it is recommended that you rotate between your primary and secondary keys. To rotate keys, update your app to use the secondary key, deploy, then press the cycle/refresh button beside the primary key to generate a new primary key. The old primary key will be disabled. For more information on key rotation, see [Set up Azure Key Vault with key rotation and auditing].
62
62
63
63
:::image type="content" source="./media/quick-android-map/get-key.png" alt-text="A screenshot showing the Azure Maps Primary key in the Azure portal.":::
64
64
@@ -76,15 +76,15 @@ Complete the following steps to create a new project with an empty activity in A
76
76
77
77
:::image type="content" source="./media/quick-android-map/3-empty-activity.png" alt-text="A screenshot that shows the Create an Empty Activity screen in Android Studio.":::
78
78
79
-
1. In the **Empty Activity** screen you'll need to enter values for the following fields:
79
+
1. In the **Empty Activity** screen, enter values for the following fields:
80
80
***Name**. Enter **AzureMapsApp**.
81
81
***Package name**. Use the default **com.example.azuremapsapp**.
82
82
***Save location**. Use the default or select a new location to save your project files. Avoid using spaces in the path or filename due to potential problems with the NDK tools.
83
83
***Language**. Select Kotlin or Java.
84
84
***Minimum SDK**. Select `API 21: Android 5.0.0 (Lollipop)` as the minimum SDK. It's the earliest version supported by the Azure Maps Android SDK.
85
85
1. Select **Finish** to create your new project.
86
86
87
-
See the [Android Studio documentation](https://developer.android.com/studio/intro/) for more help with installing Android Studio and creating a new project.
87
+
See the [Android Studio documentation] for more help with installing Android Studio and creating a new project.
88
88
89
89
## Set up a virtual device
90
90
@@ -96,7 +96,7 @@ To set up an Android Virtual Device (AVD):
1. In the **Phones** category, select **Nexus 5X**, and then select **Next**.
98
98
99
-
You can learn more about setting up an AVDin the [Android Studio documentation](https://developer.android.com/studio/run/managing-avds).
99
+
For more information about setting up an AVD, see [Create and manage virtual devices]in the Android Studio documentation.
100
100
101
101
:::image type="content" source="./media/quick-android-map/4-avd-select-hardware.png" alt-text="A screenshot that shows the Select Hardware screen in Android Virtual Device Manager when creating a new Virtual Device.":::
102
102
@@ -121,14 +121,13 @@ The next step in building your application is to install the Azure Maps Android
121
121
:::image type="content" source="./media/quick-android-map/project-settings-file.png" alt-text="A screenshot of the project settings file in Android Studio.":::
122
122
123
123
3. Open the project's **gradle.properties** file, verify that `android.useAndroidX` and `android.enableJetifier` are both set to `true`.
124
-
124
+
125
125
If the **gradle.properties** file doesn't include `android.useAndroidX` and `android.enableJetifier`, add the next two lines to the end of the file:
126
-
126
+
127
127
```gradle
128
128
android.useAndroidX=true
129
129
android.enableJetifier=true
130
130
```
131
-
132
131
133
132
4. Open the application **build.gradle** file and do the following:
134
133
@@ -169,7 +168,7 @@ The next step in building your application is to install the Azure Maps Android
169
168
170
169
::: zone pivot="programming-language-java-android"
171
170
172
-
6. In the **MainActivity.java** file you'll need to:
171
+
6. In the **MainActivity.java** file:
173
172
174
173
* Add imports for the Azure Maps SDK.
175
174
* Set your Azure Maps authentication information.
@@ -277,7 +276,7 @@ The next step in building your application is to install the Azure Maps Android
277
276
278
277
::: zone pivot="programming-language-kotlin"
279
278
280
-
7. In the **MainActivity.kt** file you'll need to:
279
+
7. In the **MainActivity.kt** file:
281
280
282
281
* add imports for the Azure Maps SDK
283
282
* set your Azure Maps authentication information
@@ -397,7 +396,7 @@ Android Studio takes a few seconds to build the application. After the build is
397
396
## Clean up resources
398
397
399
398
>[!WARNING]
400
-
> The tutorials listed in the [Next Steps](#next-steps) section detail how to use and configure Azure Maps with your account. Don't clean up the resources created in this quickstart if you plan to continue to the tutorials.
399
+
> The tutorials listed in the [Next Steps] section detail how to use and configure Azure Maps with your account. Don't clean up the resources created in this quickstart if you plan to continue to the tutorials.
401
400
402
401
If you don't plan to continue to the tutorials, take these steps to clean up the resources:
403
402
@@ -412,15 +411,30 @@ If you don't plan on continuing to develop with the Azure Maps Android SDK:
412
411
413
412
For more code examples, see these guides:
414
413
415
-
* [Manage authentication in Azure Maps](how-to-manage-authentication.md)
416
-
* [Change map styles in Android maps](set-android-map-styles.md)
417
-
* [Add a symbol layer](how-to-add-symbol-to-android-map.md)
418
-
* [Add a line layer](android-map-add-line-layer.md)
419
-
* [Add a polygon layer](how-to-add-shapes-to-android-map.md)
414
+
* [Manage authentication in Azure Maps]
415
+
* [Change map styles in Android maps]
416
+
* [Add a symbol layer]
417
+
* [Add a line layer]
418
+
* [Add a polygon layer]
420
419
421
420
## Next steps
422
421
423
422
In this quickstart, you created your Azure Maps account and created a demo application. Take a look at the following tutorial to learn more about Azure Maps:
424
423
425
424
> [!div class="nextstepaction"]
426
-
> [Load GeoJSON data into Azure Maps](tutorial-load-geojson-file-android.md)
425
+
> [Tutorial: Load GeoJSON data into Azure Maps Android SDK]
426
+
427
+
[Add a line layer]: android-map-add-line-layer.md
428
+
[Add a polygon layer]: how-to-add-shapes-to-android-map.md
429
+
[Add a symbol layer]: how-to-add-symbol-to-android-map.md
430
+
[Android Studio documentation]: https://developer.android.com/studio/intro
0 commit comments