ArcGIS Runtime SDK for Android Early Access Preview Samples for Android Studio. The ArcGIS Android SDK Gradle samples depends on the ArcGIS Runtime SDK for Android library module for Android Studio you will need to clone both repositories and add the ArcGIS Android API Library Module to the gradle sample project.
Caution: The ArcGIS Android SDK Gradle samples are currently available as an early access preview for use with Android Studio and the ArcGIS Android API Library Module. If you are not comfortable using an unfinished product, you may want to use ArcGIS Android Samples in the Eclipse Plugin bundled with the ArcGIS Android SDK.
- JDK 6 or higher
- Android Studio 0.5.8+ with support for gradle plugin
0.10.+
. Use the Canary Channel to update. - Android Support Library. Ensure that your SDK Manager for Android Studio has the support library installed. We make use of v7 appcompat library to follow Android design guidelines
The ArcGIS Android SDK Samples are Gradle based Android projects which can be directly cloned and imported into Android Studio. The ArcGIS Android SDK Samples require the ArcGIS Android API Library Module to be imported into the ArcGIS Android SDK Samples project.
If you haven't already, go to https://github.com/ArcGIS/arcgis-android-sdk-gradle-samples and click the Fork button and go to https://github.com/ArcGIS/arcgis-android-api-lib-module and click the Fork button.
Clone the ArcGIS Android SDK Samples and ArcGIS Android API Library Module in Android Studio.
- Choose VCS > Checkout from Version Control > GitHub on the main menu.
- From the Repository drop-down list, select the source repository to clone the data from.
- In the Folder text box, specify the directory where the local repository for cloned sources will be set up.
- Click the Clone button to start cloning the sources from the specified remote repository.
Clone the ArcGIS Android SDK Samples and ArcGIS Android API Library Module
Open your terminal, navigate to your working directory, use git clone
to get a copy of the repo.
# Clones your fork of the repository into the current directory in terminal
$ git clone [email protected]:YOUR-USERNAME/arcgis-android-sdk-gradle-samples.git
$ git clone [email protected]:YOUR-USERNAME/arcgis-android-api-lib-module.git
Now that we have both repos cloned locally we can begin to import our gradle samples project and add the ArcGIS Android API Library Module module to that project as a dependency.
Once the project is cloned to disk you can import into Android Studio:
- From the toolbar select File > Import Project
- Navigate to the root project folder, arcgis-android-sdk-gradle-samples and click OK
This is where we start to turn our project into an ArcGIS for Android project.
- Right Click your project and select Open Module Settings
- Click the
+
sign above SDK Location and select Import Existing Project then click Next - Navigate to the folder where you cloned the
arcgis-android-api-lib-module
repo and select thearcgis-android-v10.2.3
folder which contains the library module. Do not import the entire project, just the library module e.g./[path-to-repo]/arcgis-android-api-lib-module/arcgis-android-v10.2.3
and click OK then Finish to import the library module.
NOTE If you navigate to the root project directory you will see all available modules listed. Ensure that arcgis-android-v10.2.3
module is select from your project and that the app module is unchecked.
You should now be able to run any of the included samples. We will use the HelloWorld
Sample as an example.
- Select
HelloWorld
from the Select Run/Dubug Configuration drop down - Click the Run button