Data Collection Android

Data Collection for Android shows how a robust application can be built around the ArcGIS Platform using the ArcGIS Runtime SDK for Android and Kotlin. It demonstrates best practices around some simple but key functionality of the ArcGIS Runtime. Using your organization's web maps, you can use Data Collection as is, or extend it to meet your specific needs.

SDK Usage

Mobile Data Collection leverages several aspects of the Runtime SDK including:

  • Identifying map features
  • Portal authentication with OAuth 2.0
  • Working with Features, Popups and PopupManagers

Development Instructions

Data Collection is an Android Studio project and app module that can be directly cloned and imported into Android Studio.

  1. Log in to ArcGIS for Developers and register your app.

Register1

  1. Once you've registered the Data Collection app, grab a copy of the client id from the registration and set the client_id in the application's app_settings.xml file.
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!-- TODO: add your own client id here-->
    <string name="client_id">YOUR_CLIENT_ID</string>

    <!-- This redirect URI is the default value for https://www.arcgis.com -->
    <string name="redirect_uri">data-collection://auth</string>

</resources>
  1. As part of the registration process, add a redirect URI for your app. Navigate to the Redirect URIs section at the bottom of the registration page and set the redirect URI to data-collection://auth.
    Register2

Note that the scheme for the DefaultOAuthIntentReceiver in the Android Manifest file is derived from the redirect uri.

        <activity
            android:name="com.esri.arcgisruntime.security.DefaultOAuthIntentReceiver"
            android:label="OAuthIntentReceiver"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data
                        android:host="auth"
                        android:scheme="data-collection"/>
            </intent-filter>
        </activity>

GitHub