Skip to content
This repository was archived by the owner on Jan 26, 2023. It is now read-only.

Commit c734a8e

Browse files
authored
Release 100.14.0.0 (#977)
1 parent d260051 commit c734a8e

File tree

382 files changed

+14128
-12989
lines changed

Some content is hidden

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

382 files changed

+14128
-12989
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Description
2+
<!--
3+
PR to add a new Kotlin sample _"SAMPLE_NAME"_ in `SAMPLE_CATEGORY` category.
4+
-->
5+
## Links and Data
6+
<!--
7+
Sample Epic: `runtime/common-samples/issues/ISSUE_NUMBER`
8+
-->
9+
## What To Review
10+
<!--
11+
- Review the code to make sure it is easy to follow like other samples on Android
12+
- `README.md` and `README.metadata.json` files
13+
-->
14+
15+
## How to Test
16+
<!--
17+
Run the sample on the sample viewer or the repo.
18+
-->
19+
20+
<!-- OPTIONAL
21+
## To Discuss
22+
-->
23+
24+
<!-- OPTIONAL
25+
## Screenshots
26+
-->

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Overview
2-
ArcGIS Runtime API for Android v100.13.0 samples. The `main` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.
2+
ArcGIS Runtime API for Android v100.14.0 samples. The `main` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.
33

44
# Prerequisites
55
* The samples are building with `compileSdkVersion 31`

java/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ArcGIS Android Java Samples
22

33
## Requirements
4-
- [Android Plugin for Gradle 3.0.0](https://developer.android.com/studio/build/gradle-plugin-3-0-0.html)
4+
- [Android Plugin for Gradle 7.0.2](https://developer.android.com/studio/releases/gradle-plugin#7-0-0)
55

66
## Import Java Samples into Android Studio
77

java/add-enc-exchange-set/src/main/java/com/esri/arcgisruntime/sample/addencexchangeset/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {
5959

6060
// get a reference to the map view
6161
mMapView = findViewById(R.id.mapView);
62-
// create a map with the BasemapType topographic
62+
// create a map with the Basemap Style topographic
6363
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);
6464
// set the map to be displayed in this view
6565
mMapView.setMap(map);

java/add-features-feature-service/src/main/java/com/esri/arcgisruntime/sample/addfeaturesfeatureservice/MainActivity.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3333
import com.esri.arcgisruntime.data.Feature;
3434
import com.esri.arcgisruntime.data.FeatureEditResult;
35+
import com.esri.arcgisruntime.data.FeatureTableEditResult;
3536
import com.esri.arcgisruntime.data.ServiceFeatureTable;
37+
import com.esri.arcgisruntime.data.ServiceGeodatabase;
3638
import com.esri.arcgisruntime.geometry.Point;
3739
import com.esri.arcgisruntime.layers.FeatureLayer;
3840
import com.esri.arcgisruntime.mapping.ArcGISMap;
@@ -62,15 +64,20 @@ public class MainActivity extends AppCompatActivity {
6264
// create a map with streets basemap
6365
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
6466

65-
// create service feature table from URL
66-
mServiceFeatureTable = new ServiceFeatureTable(getString(R.string.service_layer_url));
67-
68-
// create a feature layer from table
69-
FeatureLayer featureLayer = new FeatureLayer(mServiceFeatureTable);
70-
71-
// add the layer to the map
72-
map.getOperationalLayers().add(featureLayer);
73-
67+
// create and load the service geodatabase
68+
ServiceGeodatabase serviceGeodatabase = new ServiceGeodatabase(getString(R.string.service_layer_url));
69+
serviceGeodatabase.loadAsync();
70+
serviceGeodatabase.addDoneLoadingListener(() -> {
71+
// create a feature layer using the first layer in the ServiceFeatureTable
72+
mServiceFeatureTable = serviceGeodatabase.getTable(0);
73+
// create a feature layer from table
74+
FeatureLayer featureLayer = new FeatureLayer(mServiceFeatureTable);
75+
// add the layer to the map
76+
map.getOperationalLayers().add(featureLayer);
77+
// set map to be displayed in map view
78+
mMapView.setMap(map);
79+
mMapView.setViewpoint(new Viewpoint( 40.0, -95.0, 10000000.0));
80+
});
7481
// add a listener to the MapView to detect when a user has performed a single tap to add a new feature to
7582
// the service feature table
7683
mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) {
@@ -86,10 +93,6 @@ public class MainActivity extends AppCompatActivity {
8693
return super.onSingleTapConfirmed(event);
8794
}
8895
});
89-
90-
// set map to be displayed in map view
91-
mMapView.setMap(map);
92-
mMapView.setViewpoint(new Viewpoint( 40.0, -95.0, 10000000.0));
9396
}
9497

9598
/**
@@ -126,17 +129,13 @@ private void addFeature(Point mapPoint, final ServiceFeatureTable featureTable)
126129
private void applyEdits(ServiceFeatureTable featureTable) {
127130

128131
// apply the changes to the server
129-
final ListenableFuture<List<FeatureEditResult>> editResult = featureTable.applyEditsAsync();
132+
final ListenableFuture<List<FeatureTableEditResult>> editResult = featureTable.getServiceGeodatabase().applyEditsAsync();
130133
editResult.addDoneListener(() -> {
131134
try {
132-
List<FeatureEditResult> editResults = editResult.get();
135+
List<FeatureTableEditResult> editResults = editResult.get();
133136
// check if the server edit was successful
134137
if (editResults != null && !editResults.isEmpty()) {
135-
if (!editResults.get(0).hasCompletedWithErrors()) {
136-
runOnUiThread(() -> logToUser(false, getString(R.string.feature_added)));
137-
} else {
138-
throw editResults.get(0).getError();
139-
}
138+
runOnUiThread(() -> logToUser(false, getString(R.string.feature_added)));
140139
}
141140
} catch (InterruptedException | ExecutionException e) {
142141
runOnUiThread(() -> logToUser(true, getString(R.string.error_applying_edits, e.getCause().getMessage())));

java/add-features-feature-service/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22
<string name="app_name">Add Features - Feature Service</string>
33

4-
<string name="service_layer_url">https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0</string>
4+
<string name="service_layer_url">https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer</string>
55
<string name="feature_added">Feature successfully added</string>
66

77
<string name="error_cannot_add_to_feature_table">Cannot add a feature to this feature table</string>

java/add-graphics-renderer/src/main/java/com/esri/arcgisruntime/sample/addgraphicsrenderer/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {
5858

5959
// create MapView from layout
6060
mMapView = findViewById(R.id.mapView);
61-
// create a map with the Basemap Type topographic
61+
// create a map with the Basemap Style topographic
6262
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
6363
// add graphics overlay
6464
addGraphicsOverlay();

java/add-graphics-with-symbols/src/main/java/com/esri/arcgisruntime/sample/addgraphicswithsymbols/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected void onCreate(Bundle savedInstanceState) {
5454

5555
// inflate MapView from layout
5656
mMapView = findViewById(R.id.mapView);
57-
// create a map with the BasemapType topographic
57+
// create a map with the Basemap Style topographic
5858
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);
5959
// set the map to be displayed in this view
6060
mMapView.setMap(map);

java/add-point-scene-layer/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ android {
99
targetSdkVersion rootProject.ext.targetSdkVersion
1010
versionCode rootProject.ext.versionCode
1111
versionName rootProject.ext.versionName
12+
buildConfigField("String", "API_KEY", API_KEY)
1213
}
1314

1415
buildTypes {

java/add-point-scene-layer/src/main/java/com/esri/arcgisruntime/sample/addpointscenelayer/MainActivity.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
import android.os.Bundle;
2020
import androidx.appcompat.app.AppCompatActivity;
2121

22+
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
2223
import com.esri.arcgisruntime.layers.ArcGISSceneLayer;
2324
import com.esri.arcgisruntime.mapping.ArcGISScene;
2425
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;
2526
import com.esri.arcgisruntime.mapping.Basemap;
27+
import com.esri.arcgisruntime.mapping.BasemapStyle;
2628
import com.esri.arcgisruntime.mapping.Surface;
2729
import com.esri.arcgisruntime.mapping.view.SceneView;
2830

@@ -35,10 +37,14 @@ protected void onCreate(Bundle savedInstanceState) {
3537
super.onCreate(savedInstanceState);
3638
setContentView(R.layout.activity_main);
3739

40+
// authentication with an API key or named user is required to access basemaps and other
41+
// location services
42+
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);
43+
3844
mSceneView = findViewById(R.id.sceneView);
3945

4046
// create a scene with a basemap and add it to the scene view
41-
ArcGISScene scene = new ArcGISScene(Basemap.Type.IMAGERY);
47+
ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);
4248
mSceneView.setScene(scene);
4349

4450
// set the base surface with world elevation

0 commit comments

Comments
 (0)