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

Commit

Permalink
Release 100.14.0.0 (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham7109 committed Apr 27, 2022
1 parent d260051 commit c734a8e
Show file tree
Hide file tree
Showing 382 changed files with 14,128 additions and 12,989 deletions.
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,26 @@
## Description
<!--
PR to add a new Kotlin sample _"SAMPLE_NAME"_ in `SAMPLE_CATEGORY` category.
-->
## Links and Data
<!--
Sample Epic: `runtime/common-samples/issues/ISSUE_NUMBER`
-->
## What To Review
<!--
- Review the code to make sure it is easy to follow like other samples on Android
- `README.md` and `README.metadata.json` files
-->

## How to Test
<!--
Run the sample on the sample viewer or the repo.
-->

<!-- OPTIONAL
## To Discuss
-->

<!-- OPTIONAL
## Screenshots
-->
2 changes: 1 addition & 1 deletion README.md
@@ -1,5 +1,5 @@
# Overview
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.
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.

# Prerequisites
* The samples are building with `compileSdkVersion 31`
Expand Down
2 changes: 1 addition & 1 deletion java/README.md
@@ -1,7 +1,7 @@
# ArcGIS Android Java Samples

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

## Import Java Samples into Android Studio

Expand Down
Expand Up @@ -59,7 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {

// get a reference to the map view
mMapView = findViewById(R.id.mapView);
// create a map with the BasemapType topographic
// create a map with the Basemap Style topographic
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);
// set the map to be displayed in this view
mMapView.setMap(map);
Expand Down
Expand Up @@ -32,7 +32,9 @@
import com.esri.arcgisruntime.concurrent.ListenableFuture;
import com.esri.arcgisruntime.data.Feature;
import com.esri.arcgisruntime.data.FeatureEditResult;
import com.esri.arcgisruntime.data.FeatureTableEditResult;
import com.esri.arcgisruntime.data.ServiceFeatureTable;
import com.esri.arcgisruntime.data.ServiceGeodatabase;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.layers.FeatureLayer;
import com.esri.arcgisruntime.mapping.ArcGISMap;
Expand Down Expand Up @@ -62,15 +64,20 @@ public class MainActivity extends AppCompatActivity {
// create a map with streets basemap
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);

// create service feature table from URL
mServiceFeatureTable = new ServiceFeatureTable(getString(R.string.service_layer_url));

// create a feature layer from table
FeatureLayer featureLayer = new FeatureLayer(mServiceFeatureTable);

// add the layer to the map
map.getOperationalLayers().add(featureLayer);

// create and load the service geodatabase
ServiceGeodatabase serviceGeodatabase = new ServiceGeodatabase(getString(R.string.service_layer_url));
serviceGeodatabase.loadAsync();
serviceGeodatabase.addDoneLoadingListener(() -> {
// create a feature layer using the first layer in the ServiceFeatureTable
mServiceFeatureTable = serviceGeodatabase.getTable(0);
// create a feature layer from table
FeatureLayer featureLayer = new FeatureLayer(mServiceFeatureTable);
// add the layer to the map
map.getOperationalLayers().add(featureLayer);
// set map to be displayed in map view
mMapView.setMap(map);
mMapView.setViewpoint(new Viewpoint( 40.0, -95.0, 10000000.0));
});
// add a listener to the MapView to detect when a user has performed a single tap to add a new feature to
// the service feature table
mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) {
Expand All @@ -86,10 +93,6 @@ public class MainActivity extends AppCompatActivity {
return super.onSingleTapConfirmed(event);
}
});

// set map to be displayed in map view
mMapView.setMap(map);
mMapView.setViewpoint(new Viewpoint( 40.0, -95.0, 10000000.0));
}

/**
Expand Down Expand Up @@ -126,17 +129,13 @@ private void addFeature(Point mapPoint, final ServiceFeatureTable featureTable)
private void applyEdits(ServiceFeatureTable featureTable) {

// apply the changes to the server
final ListenableFuture<List<FeatureEditResult>> editResult = featureTable.applyEditsAsync();
final ListenableFuture<List<FeatureTableEditResult>> editResult = featureTable.getServiceGeodatabase().applyEditsAsync();
editResult.addDoneListener(() -> {
try {
List<FeatureEditResult> editResults = editResult.get();
List<FeatureTableEditResult> editResults = editResult.get();
// check if the server edit was successful
if (editResults != null && !editResults.isEmpty()) {
if (!editResults.get(0).hasCompletedWithErrors()) {
runOnUiThread(() -> logToUser(false, getString(R.string.feature_added)));
} else {
throw editResults.get(0).getError();
}
runOnUiThread(() -> logToUser(false, getString(R.string.feature_added)));
}
} catch (InterruptedException | ExecutionException e) {
runOnUiThread(() -> logToUser(true, getString(R.string.error_applying_edits, e.getCause().getMessage())));
Expand Down
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Add Features - Feature Service</string>

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

<string name="error_cannot_add_to_feature_table">Cannot add a feature to this feature table</string>
Expand Down
Expand Up @@ -58,7 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {

// create MapView from layout
mMapView = findViewById(R.id.mapView);
// create a map with the Basemap Type topographic
// create a map with the Basemap Style topographic
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
// add graphics overlay
addGraphicsOverlay();
Expand Down
Expand Up @@ -54,7 +54,7 @@ protected void onCreate(Bundle savedInstanceState) {

// inflate MapView from layout
mMapView = findViewById(R.id.mapView);
// create a map with the BasemapType topographic
// create a map with the Basemap Style topographic
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_OCEANS);
// set the map to be displayed in this view
mMapView.setMap(map);
Expand Down
1 change: 1 addition & 0 deletions java/add-point-scene-layer/build.gradle
Expand Up @@ -9,6 +9,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
buildConfigField("String", "API_KEY", API_KEY)
}

buildTypes {
Expand Down
Expand Up @@ -19,10 +19,12 @@
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
import com.esri.arcgisruntime.layers.ArcGISSceneLayer;
import com.esri.arcgisruntime.mapping.ArcGISScene;
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.BasemapStyle;
import com.esri.arcgisruntime.mapping.Surface;
import com.esri.arcgisruntime.mapping.view.SceneView;

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

// authentication with an API key or named user is required to access basemaps and other
// location services
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);

mSceneView = findViewById(R.id.sceneView);

// create a scene with a basemap and add it to the scene view
ArcGISScene scene = new ArcGISScene(Basemap.Type.IMAGERY);
ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);
mSceneView.setScene(scene);

// set the base surface with world elevation
Expand Down
Expand Up @@ -90,7 +90,7 @@ protected void onCreate(Bundle savedInstanceState) {
// inflate MapView from layout
mMapView = findViewById(R.id.mapView);

// create a map with the BasemapType topographic
// create a map with the Basemap Style topographic
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);

// set the map to the map view
Expand Down
Expand Up @@ -391,9 +391,9 @@ private void animate(int keyFrame) {
// update the HUD
runOnUiThread(() -> {
mCurrAltitude.setText(String.format("%.2f", position.getZ()));
mCurrHeading.setText(String.format("%.2f", (float) datum.get("HEADING")));
mCurrPitch.setText(String.format("%.2f", (float) datum.get("PITCH")));
mCurrRoll.setText(String.format("%.2f", (float) datum.get("ROLL")));
mCurrHeading.setText(String.format("%.2f", datum.get("HEADING")));
mCurrPitch.setText(String.format("%.2f", datum.get("PITCH")));
mCurrRoll.setText(String.format("%.2f", datum.get("ROLL")));
});

// update mission progress seek bar
Expand Down
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {
// get a reference to the map view
mMapView = findViewById(R.id.mapView);
// create a MapImageLayer with dynamically generated map images
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer(getString(R.string.world_elevation_service));
ArcGISMapImageLayer mapImageLayer = new ArcGISMapImageLayer("https://sampleserver5.arcgisonline.com/arcgis/rest/services/Elevation/WorldElevations/MapServer");
// create an empty map instance
ArcGISMap map = new ArcGISMap();
// add map image layer as operational layer
Expand Down
@@ -1,6 +1,3 @@
<resources>
<string name="app_name">ArcGIS Map Image Layer (URL)</string>

<!-- World Topo Map Service URL -->
<string name="world_elevation_service">https://sampleserver5.arcgisonline.com/arcgis/rest/services/Elevation/WorldElevations/MapServer</string>
</resources>
Expand Up @@ -76,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) {
mPixelSizePower = 1;
mOutputBitDepth = 8;
// retrieve the MapView from layout
mMapView = (MapView) findViewById(R.id.mapView);
mMapView = findViewById(R.id.mapView);
mFragmentManager = getSupportFragmentManager();

// create raster files
Expand Down
Expand Up @@ -88,8 +88,8 @@ public void onClick(DialogInterface dialog, int which) {
}
});

mCurrAltitudeTextView = (TextView) dialogView.findViewById(R.id.curr_altitude_text);
SeekBar altitudeSeekBar = (SeekBar) dialogView.findViewById(R.id.altitude_seek_bar);
mCurrAltitudeTextView = dialogView.findViewById(R.id.curr_altitude_text);
SeekBar altitudeSeekBar = dialogView.findViewById(R.id.altitude_seek_bar);
altitudeSeekBar.setMax(90); //altitude is restricted to 0 - 90
//set initial altitude value
updateAltitudeSeekBar(altitudeSeekBar);
Expand All @@ -109,8 +109,8 @@ public void onStopTrackingTouch(SeekBar seekBar) {
}
});

mCurrAzimuthTextView = (TextView) dialogView.findViewById(R.id.curr_azimuth_text);
SeekBar azimuthSeekBar = (SeekBar) dialogView.findViewById(R.id.azimuth_seek_bar);
mCurrAzimuthTextView = dialogView.findViewById(R.id.curr_azimuth_text);
SeekBar azimuthSeekBar = dialogView.findViewById(R.id.azimuth_seek_bar);
azimuthSeekBar.setMax(360); //azimuth measured in degrees 0 - 360
//set initial azimuth value
updateAzimuthSeekBar(azimuthSeekBar);
Expand Down Expand Up @@ -141,7 +141,7 @@ public void onStopTrackingTouch(SeekBar seekBar) {
R.layout.spinner_text_view,
slopeTypeArray);

Spinner slopeTypeSpinner = (Spinner) dialogView.findViewById(R.id.slope_type_spinner);
Spinner slopeTypeSpinner = dialogView.findViewById(R.id.slope_type_spinner);
slopeTypeSpinner.setAdapter(slopeTypeSpinnerAdapter);
slopeTypeSpinner.setSelection(mSlopeType.ordinal());
slopeTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
Expand Down Expand Up @@ -179,7 +179,7 @@ public void onNothingSelected(AdapterView<?> parent) {
R.layout.spinner_text_view,
colorRampTypeArray);

Spinner colorRampSpinner = (Spinner) dialogView.findViewById(R.id.color_ramp_spinner);
Spinner colorRampSpinner = dialogView.findViewById(R.id.color_ramp_spinner);
colorRampSpinner.setAdapter(colorRampSpinnerAdapter);
colorRampSpinner.setSelection(mColorRampType.ordinal());
colorRampSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class WfsLayerInfoAdapter extends RecyclerView.Adapter<WfsLayerInfoAdapte

private final OnItemSelectedListener mOnItemSelectedListener;

private List<WfsLayerInfo> mWfsLayerInfos = new ArrayList<>();
private final List<WfsLayerInfo> mWfsLayerInfos = new ArrayList<>();
private WfsLayerInfo mSelectedWfsLayerInfo;

WfsLayerInfoAdapter(OnItemSelectedListener onItemSelectedListener) {
Expand Down Expand Up @@ -85,7 +85,7 @@ void addLayer(WfsLayerInfo wfsLayerInfo) {
*/
class ViewHolder extends RecyclerView.ViewHolder {

private TextView mTextView;
private final TextView mTextView;

ViewHolder(@NonNull View itemView) {
super(itemView);
Expand Down
2 changes: 1 addition & 1 deletion java/change-basemaps/README.md
Expand Up @@ -16,7 +16,7 @@ Use the navigation drawer to select the active basemap from the list of availabl

1. Create an `ArcGISMap` object.
2. Set the map to the `MapView` object.
3. Choose a new basemap type and set it on the map.
3. Choose a new basemap style and set it on the map.

## Relevant API
* ArcGISMap
Expand Down
Expand Up @@ -31,6 +31,7 @@
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.BasemapStyle;
import com.esri.arcgisruntime.mapping.Viewpoint;
import com.esri.arcgisruntime.mapping.view.MapView;

public class MainActivity extends AppCompatActivity {
Expand All @@ -56,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);

// inflate navigation drawer
mNavigationDrawerItemTitles = getResources().getStringArray(R.array.basemap_types);
mNavigationDrawerItemTitles = getResources().getStringArray(R.array.basemap_styles);
mDrawerList = findViewById(R.id.navList);
mDrawerLayout = findViewById(R.id.drawer_layout);
// get app title
Expand All @@ -75,9 +76,11 @@ protected void onCreate(Bundle savedInstanceState) {
// inflate MapView from layout
mMapView = findViewById(R.id.mapView);
// create a map with Topographic Basemap
mMap = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 47.6047381, -122.3334255, 12);
mMap = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);
// set the map to be displayed in this view
mMapView.setMap(mMap);
// set a viewpoint around Seattle
mMapView.setViewpoint(new Viewpoint( 47.6047381, -122.3334255, 100000));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion java/change-basemaps/src/main/res/values/strings.xml
Expand Up @@ -4,7 +4,7 @@
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>

<string-array name="basemap_types">
<string-array name="basemap_styles">
<item>Streets</item>
<item>Navigation</item>
<item>Topographic</item>
Expand Down
Expand Up @@ -56,7 +56,7 @@ protected void onCreate(Bundle savedInstanceState) {

// inflate mapView from layout
mMapView = findViewById(R.id.mapView);
// create a map with a BasemapType STREETS
// create a map with a Basemap Style STREETS
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);
// set the map to be displayed in this view
mMapView.setMap(map);
Expand Down
Expand Up @@ -46,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {

// inflate MapView from layout
mMapView = findViewById(R.id.mapView);
// create a map with the Basemap Type topographic
// create a map
ArcGISMap map = new ArcGISMap();
// create a MapImageLayer with dynamically generated map images
mMapImageLayer = new ArcGISMapImageLayer(getResources().getString(R.string.world_cities_service));
Expand Down
Expand Up @@ -331,11 +331,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// if nav drawer is opened, hide the action items
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
menu.findItem(R.id.action_save).setVisible(false);
} else {
menu.findItem(R.id.action_save).setVisible(true);
}
menu.findItem(R.id.action_save).setVisible(!mDrawerLayout.isDrawerOpen(GravityCompat.START));

return super.onPrepareOptionsMenu(menu);
}
Expand Down
Expand Up @@ -119,7 +119,7 @@ protected void onCreate(Bundle savedInstanceState) {
// get MapView from layout
mMapView = findViewById(R.id.mapView);

// create a map with the BasemapType topographic
// create a map with the Basemap Style topographic
final ArcGISMap mMap = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);

// set the map to be displayed in this view
Expand Down
Expand Up @@ -56,7 +56,7 @@ protected void onCreate(Bundle savedInstanceState) {
mMapView = findViewById(R.id.mapView);
Button cutButton = findViewById(R.id.cutButton);

// create a map with the BasemapType topographic
// create a map with the Basemap Style topographic
ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);

// set the map to be displayed in this view
Expand Down
Expand Up @@ -30,7 +30,7 @@ public class ConfirmDeleteFeatureDialog extends DialogFragment {

private String featureId;

private DialogInterface.OnClickListener mOnClickListener = (dialog, which) -> {
private final DialogInterface.OnClickListener mOnClickListener = (dialog, which) -> {
if (getContext() instanceof OnButtonClickedListener) {
if (which == DialogInterface.BUTTON_POSITIVE) {
((OnButtonClickedListener) getContext()).onDeleteFeatureClicked(featureId);
Expand Down

0 comments on commit c734a8e

Please sign in to comment.