Integration features
Esri provides two plug-ins, ArcGIS for Android Core and ArcGIS for Android Doc and Samples, that provide a rich set of tools, documentation, and samples to help a developer create applications using the ArcGIS API for Android. The following document captures and summarizes the significant features that are available to help the developer.
ArcGIS project for Android
When you create a new project in Eclipse to begin your development, there is a new project type made available through the Esri plug-ins. Do the following in Eclipse to utilize this new project type for your applications.
- From Eclipse's file menu option, select new and click project.
- In the new project dialog, expand the ArcGIS for Android folder.

- Select the ArcGIS project for Android option and click next.
- In the new Android project dialog, fill out the form as you normally would when creating an Android project in Eclipse.
- When finished, click finish to create the project.
The project that is created is defined with all of the components that are required for you to begin developing your applications using the ArcGIS API for Android. For example, notice the reference libraries container. If you expand this container in your new project, you will observe the following required Java archive (JAR) files:
![]() |
- ArcGIS_Android.jar: This library file represents the ArcGIS API for Android.
- ArcGIS_PE.jar: This library file represents the coordinate system libraries required to define spatial reference systems used by maps.
- jackson-mapper-lgpl-1.5.5.jar and jackson-core-lgpl-1.5.5.jar: These libraries represent tools used by the framework to handle the JSON parsing.
When the project is first loaded into Eclipse, you might notice that the project has an error initially. This error is due to the fact that Eclipse has multiple threads to load a project and compile it. It is possible for the compiler to complain and give an error symbol for the project because the threads fall out of sync with one another. Most of the time, however, this issue resolves itself once all the threads complete their tasks and sync up with one another, but it is possible for the error to remain. If this is the case, this issue can be resolved when the following is done:
- From Eclipse's project menu, click clean.
- In the clean dialog you are presented with an option to clean all your projects or to clean projects selected from a list. The easiest option is to select only the particular project that you have created; however, you can use the other option to clean multiple projects at once.

- Once you have decided which approach to take, click OK to clean your Eclipse project(s).
If you have the progress view enabled in Eclipse, then you will see the status of the project being recompiled. This step should resolve any of the build issues that might linger when the project is initially created. The same issue might present itself when importing sample projects into Eclipse. These instructions can also be followed to resolve those issues.
Map service selection dialog
To help expedite the process of finding and adding map services to your application, a map service selection dialog is available for you. By default, assuming you have just created an initial project, you can navigate to your application's resource folder location. Within that resource folder, Android defines an initial layout file that is used to define the layout of various user interface (UI) views. Since maps and layers ultimately translate to Android View objects using the ArcGIS API, these maps can be configured directly in a project's layout resource location, just like any other Android UI View. Your maps and layers do not need to be defined in the default main.xml resource file, but is used here to illustrate how you can use the map service selection dialog when adding your own services. Take the following steps to expose the selection dialog in your project:
- In your Eclipse project, expand the res folder.
- Expand the layout folder.
- Double-click the main.xml file to open within Eclipse. Remember that this need not be main.xml and can be any file that you define for your layout.
- Place your cursor at the location within the xml file you wish the MapView to be defined. If using the default xml file, then you should remove the default TextView element and place your cursor inside the LinearLayout tag.
- With the cursor placed in the desired location, right click within the XML editor in Eclipse, and choose ArcGIS tools from the context menu, then click add map view.

The add map services dialog displays and is designed to be intuitive to the user (with helpful hints and instructions at the bottom of the dialog). You will need to connect to an ArcGIS Server instance before you can see any map services. By default, this dialog gives you the example of the ArcGIS Online server's representational state transfer (REST) end point. Once you have specified your URL's REST end point and click connect, then the set of services that are available on the server are displayed on the left hand side of the dialog. Follow the instructions in the dialog for adding/removing or modifying the order of layers as you select items and move them to the right hand side of the dialog. The following is an example that uses ArcGIS Online to add a map service using the map service dialog.
![]() |
When you have finished, click OK to add the correct XML required to inflate the appropriate API objects when the application is executed. The following example shows the XML that is generated for map service selected previously.
![]() |
Classpath variable
In certain scenarios, it is possible that you will need to manually add the JARs to the classpath of your project. The ARCGIS_FOR_ANDROID classpath variable has been defined in Esri's plug-ins to allow you to add referenced libraries to your project so that you will be able to utilize the ArcGIS API for Android within existing projects. To manually add the JARs to your classpath in Eclipse, you must do the following:
- Right-click on the project folder you will add the JARs too. From the context menu, select build path and click configure build path.
- In the properties for <Project_Name> dialog, select the libraries tab if not already done (in the following example <Project_Name> is replaced with the Test project).

- In the properties for <Project_Name> dialog, click add variable.
- Select the ARCGIS_FOR_ANDROID variable and click extend.

- Select all four JARs and click OK.
- Click OK on the properties for <Project_Name>.
A new referenced libraries container is added to your project. If you expand this container you will see the four JARs selected above residing within the container.
Documentation
The ArcGIS API for Android will assist developers in writing their applications by providing conceptual documentation and various code snippets. The ArcGIS for Android Doc and Samples plug-in contains all of the conceptual documentation and code snippets and can be accessed through the Eclipse help system as follows:
- After you have installed the plug-ins, select the help menu from Eclipse and click help contents.

- In the table of contents, expand the ArcGIS API for Android booklet.
If you are new to the ArcGIS API for Android, then you can open the getting started book to find some preliminary documents to help you get started with your development work. For more advanced developers, you can expand the samples and reference books to start digging into existing source code and the API documentation to build your applications.
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. The how to work with samples document gives details on how to import samples into your Eclipse workspace and then run applications. The samples are designed to educate developers on common workflows and best practices when working with the ArcGIS API for Android.
![]() |



