Skip to content

Commit 0190d9e

Browse files
authored
Merge pull request #23 from ArcGIS/sample-renameing
Rebrand the Android SDK
2 parents 757c4fb + 52c99ca commit 0190d9e

File tree

74 files changed

+423
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+423
-321
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ArcGIS Android Issue Template
22

3-
GitHub is **ONLY** used for issues pertaining to ArcGIS Runtime SDK Samples. Use [Esri Community](https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions) for any general ArcGIS Runtime Android SDK questions.
3+
GitHub is **ONLY** used for issues pertaining to ArcGIS Maps SDK Kotlin Samples. Use [Esri Community](https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions) for any general ArcGIS Maps SDK questions.
44

55
Is this something you can [contribute](CONTRIBUTING.md)? Send a pull request! New Samples, bug fixes and documentation fixes are welcome.
66

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PR to add a new Kotlin sample _"SAMPLE_NAME"_ in `SAMPLE_CATEGORY` category.
44
-->
55
## Links and Data
66
<!--
7-
Sample Epic: `runtime/common-samples/issues/ISSUE_NUMBER`
7+
Sample Epic: `runtime/kotlin/issues/ISSUE_NUMBER`
88
-->
99
## What To Review
1010
<!--

README.md

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,80 @@
1-
# ArcGIS Android Kotlin Samples
1+
# ArcGIS Maps SDK Kotlin Samples
22

3-
## Requirements
4-
- [Android Plugin for Gradle 7.4.2](https://developer.android.com/studio/releases/gradle-plugin#7.4.2)
5-
- [Kotlin 1.5.20](https://blog.jetbrains.com/kotlin/2021/06/kotlin-1-5-20-released/)
3+
# Overview
4+
ArcGIS Maps SDK Kotlin for Android v200.0.0 samples. The `main` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Maps SDK Android Kotlin](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/tags). Please read our [wiki](https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/wiki) for help with working with this repository.
65

7-
## Import Kotlin Samples into Android Studio
6+
# Prerequisites
7+
* The samples are building with `compileSdkVersion 33`
8+
* [Android Studio](http://developer.android.com/sdk/index.html)
9+
* [An ArcGIS Developers API key](https://developers.arcgis.com/android/get-started/#3-get-an-api-key)
810

9-
- From the Android Studio toolbar select **File > Import Project** project from the **Welcome Quick Start**.
10-
- Navigate to the **kotlin** project directory and click OK
11+
## Developer Instructions
12+
Please read our [developer instructions wiki page](https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/wiki/dev-instructions) to set up your developer environment with Android Studio. Instructions include forking and cloning the repository for those new to Git.
13+
14+
Once the project is cloned to disk you can import into Android Studio:
15+
16+
* From the Welcome to Android Studio screen, click the **Open** button. (If you're already inside a project, click **File > Open** in the menu bar instead.)
17+
* Navigate to the **arcgis-maps-sdk-kotlin-samples/** folder and click **OK**.
18+
19+
## Accessing Esri location services
20+
Accessing Esri location services, including basemaps, routing, and geocoding, requires authentication using either an API Key or an ArcGIS identity:
21+
1. API key: A permanent key that gives your application access to Esri location services. Visit your [ArcGIS Developers Dashboard](https://developers.arcgis.com/dashboard) to create a new API key or access an existing API key.
22+
23+
The Android samples in this repository have been structured to use an API key, set once, which will run in all samples. Set your API key in the `gradle.properties` file located in the `/.gradle` folder within your home directory (`/Users/<user_name>/.gradle/gradle.properties`). The API_KEY property should contain quotes around the key itself: `API_KEY = "YOUR_API_KEY"`
24+
25+
2. ArcGIS identity: An ArcGIS named user account that is a member of an organization in ArcGIS Online or ArcGIS Enterprise.
26+
27+
## Run a sample
28+
Once you have set up your developer environment you can run any sample from within Android Studio by selecting the app module from the **Edit Configurations** drop down and clicking the **Run** button from the toolbar.
29+
30+
### Build/Run sample from Gradle
31+
You can execute all the build tasks using the [Gradle Wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) command line tool. It's available as a batch file for Windows (gradlew.bat) and a shell script for Linux/Mac (gradlew.sh) and it is accessible from the root of the project.
32+
33+
- Build a debug APK
34+
35+
```
36+
$ ./gradlew assembleDebug
37+
```
38+
39+
- Run the app
40+
41+
**Device**
42+
```
43+
adb -d install path/to/sample.apk
44+
```
45+
46+
Built APK's are saved to **arcgis-maps-sdk-kotlin-samples/[module-name]/build/outputs/apk/**. More information about running apps on devices can be found [here](https://developer.android.com/studio/run/device.html).
47+
48+
### Run samples through the sample viewer
49+
The samples in this repository can also be viewed in a single sample viewer app. It can be found on the Play Store or [on ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=21ac248ea189406c821400dc28bf686c). If downloading from ArcGIS Online, follow these instructions to run the app locally on your device:
50+
- Download and unzip the file to get the apk **ArcGIS_Maps_SDK_Sample_Viewer_Android_20000.apk**.
51+
52+
## Issues
53+
54+
Have a question about functionality in the ArcGIS Maps SDK Kotlin Samples? Want to ask other users for development advice, discuss a workflow, ask Esri staff and other users about bugs in the API? Use [GeoNet](https://community.esri.com/t5/arcgis-runtime-sdk-for-android/bd-p/arcgis-runtime-sdk-for-android-questions) for any general questions like this, so others can learn from and contribute to the discussion.
55+
56+
Do you have something to [contribute](.github/CONTRIBUTING.md)? Send a pull request! New Samples, bug fixes and documentation fixes are welcome.
57+
58+
Have a problem running one of the samples in this repo? Does the sample not work on a specific device? Have questions about how the code in this repo is working? Want to request a specific sample? In that case, [submit a new issue](https://github.com/Esri/arcgis-maps-sdk-kotlin-samples/issues).
59+
60+
61+
## Contributing
62+
Anyone and everyone is welcome to [contribute](.github/CONTRIBUTING.md). We do accept pull requests.
63+
64+
1. Get Involved
65+
2. Report Issues
66+
3. Contribute Code
67+
4. Improve Documentation
68+
69+
Please see our [guidelines for contributing doc](https://github.com/Esri/contributing/blob/main/README.md)
70+
71+
## Licensing
72+
Copyright 2022 Esri
73+
74+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
75+
76+
http://www.apache.org/licenses/LICENSE-2.0
77+
78+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
79+
80+
A copy of the license is available in the repository's [license.txt](https://github.com/Esri/arcgis-android-sdk-gradle-samples/blob/main/LICENSE) file.

add-feature-layers/README.metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"ShapefileFeatureTable"
3838
],
3939
"snippets": [
40-
"src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/DownloadActivity.kt",
41-
"src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/MainActivity.kt"
40+
"src/main/java/com/esri/arcgismaps/sample/addfeaturelayers/DownloadActivity.kt",
41+
"src/main/java/com/esri/arcgismaps/sample/addfeaturelayers/MainActivity.kt"
4242
],
4343
"title": "Add feature layers"
4444
}

add-feature-layers/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ android {
55
compileSdkVersion rootProject.ext.compileSdkVersion
66

77
defaultConfig {
8-
applicationId "com.esri.arcgisruntime.sample.addfeaturelayers"
8+
applicationId "com.esri.arcgismaps.sample.addfeaturelayers"
99
minSdkVersion rootProject.ext.minSdkVersion
1010
targetSdkVersion rootProject.ext.targetSdkVersion
1111
versionCode rootProject.ext.versionCode

add-feature-layers/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.esri.arcgisruntime.sample.addfeaturelayers">
3+
package="com.esri.arcgismaps.sample.addfeaturelayers">
44

55
<uses-permission android:name="android.permission.INTERNET" />
66

add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/DownloadActivity.kt renamed to add-feature-layers/src/main/java/com/esri/arcgismaps/sample/addfeaturelayers/DownloadActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.esri.arcgisruntime.sample.addfeaturelayers
1+
package com.esri.arcgismaps.sample.addfeaturelayers
22

33
import android.content.Intent
44
import android.os.Bundle
5-
import com.esri.arcgisruntime.sample.sampleslib.DownloaderActivity
5+
import com.esri.arcgismaps.sample.sampleslib.DownloaderActivity
66

77
class DownloadActivity : DownloaderActivity() {
88
override fun onCreate(savedInstanceState: Bundle?) {

add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/MainActivity.kt renamed to add-feature-layers/src/main/java/com/esri/arcgismaps/sample/addfeaturelayers/MainActivity.kt

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,29 @@
1414
*
1515
*/
1616

17-
package com.esri.arcgisruntime.sample.addfeaturelayers
17+
package com.esri.arcgismaps.sample.addfeaturelayers
1818

1919
import android.os.Bundle
2020
import android.util.Log
21-
import android.view.View
2221
import android.widget.ArrayAdapter
2322
import android.widget.Toast
2423
import androidx.appcompat.app.AppCompatActivity
2524
import androidx.databinding.DataBindingUtil
2625
import androidx.lifecycle.lifecycleScope
27-
import arcgisruntime.ApiKey
28-
import arcgisruntime.ArcGISRuntimeEnvironment
29-
import arcgisruntime.data.GeoPackage
30-
import arcgisruntime.data.Geodatabase
31-
import arcgisruntime.data.ServiceFeatureTable
32-
import arcgisruntime.data.ShapefileFeatureTable
33-
import arcgisruntime.mapping.ArcGISMap
34-
import arcgisruntime.mapping.BasemapStyle
35-
import arcgisruntime.mapping.Viewpoint
36-
import arcgisruntime.mapping.ViewpointType
37-
import arcgisruntime.mapping.layers.FeatureLayer
38-
import arcgisruntime.portal.Portal
39-
import arcgisruntime.portal.PortalItem
40-
import com.esri.arcgisruntime.sample.addfeaturelayers.databinding.ActivityMainBinding
41-
import kotlinx.coroutines.Dispatchers
26+
import com.arcgismaps.ApiKey
27+
import com.arcgismaps.ArcGISEnvironment
28+
import com.arcgismaps.data.GeoPackage
29+
import com.arcgismaps.data.Geodatabase
30+
import com.arcgismaps.data.ServiceFeatureTable
31+
import com.arcgismaps.data.ShapefileFeatureTable
32+
import com.arcgismaps.mapping.ArcGISMap
33+
import com.arcgismaps.mapping.BasemapStyle
34+
import com.arcgismaps.mapping.Viewpoint
35+
import com.arcgismaps.mapping.layers.FeatureLayer
36+
import com.arcgismaps.portal.Portal
37+
import com.arcgismaps.portal.PortalItem
38+
import com.esri.arcgismaps.sample.addfeaturelayers.databinding.ActivityMainBinding
4239
import kotlinx.coroutines.launch
43-
import kotlinx.coroutines.withContext
4440
import java.io.File
4541

4642

@@ -77,7 +73,7 @@ class MainActivity : AppCompatActivity() {
7773
super.onCreate(savedInstanceState)
7874
// authentication with an API key or named user is
7975
// required to access basemaps and other location services
80-
ArcGISRuntimeEnvironment.apiKey = ApiKey.create(BuildConfig.API_KEY)
76+
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.API_KEY)
8177
lifecycle.addObserver(mapView)
8278
// set the map to be displayed in as the BasemapStyle topographic
8379
activityMainBinding.mapView.map = ArcGISMap(BasemapStyle.ArcGISTopographic)

add-feature-layers/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<androidx.constraintlayout.widget.ConstraintLayout
77
android:layout_width="match_parent"
88
android:layout_height="match_parent"
9-
tools:context="com.esri.arcgisruntime.sample.addfeaturelayers.MainActivity">
9+
tools:context=".MainActivity">
1010

11-
<arcgisruntime.mapping.view.MapView
11+
<com.arcgismaps.mapping.view.MapView
1212
android:id="@+id/mapView"
1313
android:layout_width="0dp"
1414
android:layout_height="0dp"

change-viewpoint/README.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"Viewpoint"
3333
],
3434
"snippets": [
35-
"src/main/java/com/esri/arcgisruntime/sample/changeviewpoint/MainActivity.kt"
35+
"src/main/java/com/esri/arcgismaps/sample/changeviewpoint/MainActivity.kt"
3636
],
3737
"title": "Change viewpoint"
3838
}

0 commit comments

Comments
 (0)