How to work with samples

The ArcGIS Runtime SDK samples for Android are simple tools for developers to understand and implement the essential features in their own applications. This document describes how to access the samples, import them into your Eclipse integrated development environment (IDE), 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 step-by-step instruction for accessing samples and importing them into your Eclipse workspace:

  1. On the Eclipse menu, choose File > New > Select Project.
  2. Expand the ArcGIS for Android folder on the New Project dialog box.
    New Project dialog
  3. Choose ArcGIS Samples for Android and click Next.

    The New ArcGIS Sample for Android dialog box appears and displays a tree view of the samples available.

    ArcGIS Sample for Android dialog
  4. From here, expand the tree view to find the sample you are looking for.

Once a sample is selected, it is possible for you to change the project name or 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 imported into the workspace using the project name value. Thus, you can modify the source code of the project as if the project were created from scratch, and this will not affect 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 on your physical device.

Using a physical Android device

You must develop and test your sample application directly on a physical device 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 set up, the same instructions can be followed for deploying your applications to a phone.

Please refer to the following Android developer guide topic for Building and Running from Ecilpse with ADT using either the device or emulator.

NoteNote:

Please refer to the following blog post for steps to deploy your apps to an emulator

Related Topics

5/31/2012