How to work with samples
The ArcGIS Samples for Android that are provided by Esri are simple tools for developers to understand and implement the essential features in their own applications. This document describes how to access the samples and import them into your Eclipse integrated development environment (IDE), and then run them once they are within Eclipse.
Using the Eclipse IDE to import samples
Once you have successfully installed the Esri provided plug-ins, you can use Eclipse's new project wizard to import samples into your workspace. The following gives a step-by-step for accessing samples and importing them into your Eclipse workspace:
- On the Eclipse menu, choose file, new, and select project.
- Expand the ArcGIS for Android folder in the new project dialog.

- Select ArcGIS Samples for Android and click next.
- A new ArcGIS Sample for Android dialog appears and displays a tree view of the samples available.

- From here, you can expand the tree view to find the sample you are looking for.
From this dialog, you can expand the tree view to find the sample you are interested in working with. Once the sample is selected, it is possible for you to change the project name or to change the default workspace location. By default, the project name is the same as the sample name and the default location is your current workspace. When you have selected a sample and click the finish button, the sample is then imported into the workspace using the project name value. Thus, you can modify the source code of the project as if the project was created from scratch and this will not effect the original sample from the plug-in.
Running the samples
Samples are designed to execute once imported into the Eclipse IDE. See the documentation for each sample for any special instructions that might be required of you when working with the sample. In general, If you right-click the sample project in Eclipse and choose "Run As -> Android application", the sample should execute. This assumes that you have either a pre-configured Android virtual device (AVD) or an actual physical device connected to and configured with your development machine via universal serial bus (USB).
Using the Android virtual device and emulator
The AVD is a device configuration for the emulator that allows you to model real world devices. In order to run an instance of the emulator, you must create an AVD using the tools that come with the Android development tool (ADT) plug-in for Eclipse. The step-by-step instructions for creating an AVD can be found in the online document, Developing In Eclipse, with ADT. Immediately after these instructions are additional step-by-step directions for running the application on the emulator. These directions can be used to run any of the samples provided by the plug-in.
Using a physical Android device
Alternatively, you can develop and test your sample application directly on a physical device which may be connected to your machine through a USB connection. See the specific section in Android's Dev Guide for developing on a physical device. Identical to the AVD, once the physical device is setup, then the same instructions can be followed for deploying your applications to a phone.