Skip to content

The Squad Leader template demonstrates best practices for building handheld military applications with ArcGIS.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
license.txt
Unknown
license-ThirdParty.txt
Notifications You must be signed in to change notification settings

joseanta/squad-leader-android

 
 

Repository files navigation

squad-leader-android

The Squad Leader template demonstrates best practices for building handheld military applications with the ArcGIS Runtime SDK for Android. The Squad Leader template contains source code for a handheld application and directions for building the application from source. To download a precompiled distribution of the application, visit ArcGIS for Defense and Intelligence.

Image of squad-leader-android

Sections

Requirements

To run the app:

  • Android 2.3.3 or higher
    • Limited functionality when running on an Android emulator (more info)

To build the app from source:

  • Android SDK
    • Android API 14 or higher is required to build, even though the app will run on Android 2.3.3 (API 10) or higher
  • ArcGIS Runtime SDK 10.2 (or higher) for Android
    • Even if you have installed the Eclipse plugin from the online update site, you'll need to download the SDK to get the native binary files (see build steps).
  • Eclipse 3.6.2 or higher (Eclipse for Android recommended)
  • Android Support Library

Building from Source

Building with Eclipse

  1. Clone this repository, or fork it and clone your fork.
  2. Download and install the ArcGIS Runtime SDK for Android,
    1. Unzip the SDK
    2. Copy the contents of the arcgis-android-sdk/libs directory from the SDK to your clone's source/SquadLeader/libs directory.
    3. NOTE: If app size is an issue and you know you don't need to run Squad Leader on a particular platform, you can omit one or more of the directories (armeabi, armeabi-v7a, x86).
  3. Get the latest military symbology files (mil2525c.dat, messagetypes/*.json):
    1. Clone the Esri/military-features-data repo, or fork it and clone your fork.
    2. Copy all the .json files from Esri/military-features-data/data/mil2525c/messagetypes to the source/SquadLeader/assets/2525cSymDictionary/MessageTypes directory in your Squad Leader clone.
    3. Copy mil2525c.dat from Esri/military-features-data/data/mil2525c to the source/SquadLeader/assets/2525cSymDictionary directory in your Squad Leader clone.
  4. Check and if necessary install the Android Support Library v7 appcompat
    1. Follow the instructions on the Android support site for checking and/or adding the Android Support Library.
    2. To verify, from a command prompt, run android and observe the library is checked
  5. Open Eclipse for Android. Some IMPORTANT NOTES:
    1. When adding/importing projects to Eclipse ensure that you use the Android Import option: Android > Import Existing Android Code into Workspace.
    2. This can be found at File > Import > Android > Existing Android Code Into Workspace.
    3. When importing code, do not select/check the option copy the project to the workspace unless you know what you're doing.
    4. Once a project has been imported, verify that the Android Property Page contains no broken links. If so, you will need to remove and re-add the project.
  6. Add/import the Android Support Library v7 appcompat into your Eclipse Workspace
    1. In Eclipse import {Android SDK Home}\sdk\extras\android\support\v7\appcompat.
    2. This provides a library project called android-support-v7-appcompat.
  7. Add/import the aFileChooser project and check its properties
    1. The squad-leader-android repo contains the aFileChooser repo as a submodule in the source directory: squad-leader-android\source\aFileChooser\aFileChooser
    2. Add/import the aFileChooser Eclipse Android project to the workspace
    3. Check the properties - right-click the project and choose Properties > Android. If any of the project's references are broken (e.g. android-support-v7-appcompat), remove it and re-add the reference.
  8. Add/import the SquadLeader project and check its properties
    1. Add/import the SquadLeader Eclipse Android project to the workspace from: squad-leader-android\source\SquadLeader
    2. Check the properties - right-click the project and choose Properties > Android. If any of the project's references are broken (e.g. android-support-v7-appcompat, aFileChooser), remove it and re-add the reference.
    3. Ensure that the SquadLeader project is an ArcGIS Android Project. Right-click the project and choose ArcGIS Tools > Convert to ArcGIS Android Project if necessary.
  9. If any of the three projects (SquadLeader, android-support-v7-appcompat, aFileChooser) have errors, you may need to try the following:
    1. You may need to set the Android API level. Right-click the project and choose Properties > Android. Choose an Android API level 14 or higher. If you don't have API 14 or higher, install one in Eclipse by choosing Window > Android SDK Manager and selecting SDK Platform for API 14 or higher.
    2. Right-click the project and choose Android Tools > Fix Project Properties
    3. Right-click the SquadLeader project and choose ArcGIS Tools > Fix Project Properties - If ArcGIS Tools does not appear in the context menu, go back to the system requirements above and ensure you haved installed the ArcGIS Runtime SDK 10.2 for Android Eclipse Plugin.
    4. You may also need to clean and re-build the SquadLeader, aFileChooser, and/or android-support-v7-appcompat projects.
  10. To run directly from Eclipse
    1. Right-click the SquadLeader project and choose Run As > Android Application.
    2. If you wish to run in an emulator, see: Notes on Running with the Android Emulator
  11. To create an installer (.apk), right-click the project and choose Export. Choose Android > Export Android Application and step through the wizard.

Building with Ant

  1. The following steps configure the project for building with ant.
  2. IMPORTANT NOTE: the ant and Eclipse configurations are not compatible so should not be used together (you should choose one or the other but not both).
  3. Configure Android, Java, and Ant to run from the command line
    1. It is assumed that users who select this option will be familiar with the steps necessary to configure these tools for command line usage (usually just adding the install directory to the path, e.g. for Android, set PATH=%PATH%;{ADT-Install}\sdk\tools)
    2. If not, please consult the documentation for each tool.
    3. To verify that your environment is correctly configured, from a command prompt enter the following and verify each command returns without errors:
      1. > android -h
      2. > java -version
      3. > ant -version
  4. Perform Steps 1-4 from Building with Eclipse for cloning the projects and installing the support library.
  5. For each of the following projects:
    1. {Android SDK Home}\sdk\extras\android\support\v7\appcompat
    2. squad-leader-android\source\aFileChooser\aFileChooser
    3. squad-leader-android\source\SquadLeader
    4. Do the following:
      1. Check/edit the project.properties file to ensure that it points to the correct folder(s)
      2. From the command line change to that directory and run the following command: > android update project --path . (Note: this will create an ant build.xml file in each project directory)
  6. Edit the file: squad-leader-android\source\SquadLeader\custom_rules.xml to point to the correct location of the ArcGIS for Android SDK install (this file is run as part of the build).
  7. From squad-leader-android\source\SquadLeader, build using the desired ant task e.g. : >ant release
    1. NOTE: if you receive an error during build: "Could not reserve enough space for object heap," you may need to see the following environment variable from the command prompt: > SET _JAVA_OPTIONS=-Xmx512M

Running unit tests

Running Unit Tests using Eclipse for Android

  1. Follow the Building with Eclipse steps above.
  2. In the same Eclipse workspace, add/import the project found at source/SquadLeader/tests. The project name is SquadLeaderTest.
  3. To run the SquadLeaderTest project, right-click the project and choose Run As > Android JUnit Test.
  4. If you wish to run in an emulator, see: Note on Running with the Android Emulator

Running Unit Tests using Ant

  1. Once you have configured the project for building with ant
  2. >ant debug install test

Notes on Running with the Android Emulator

  1. Like any app using ArcGIS Runtime for Android, Squad Leader can run on an Android emulator.
  2. If you wish to run in an emulator, you must follow the directions in this blog post to ensure that the emulator has proper hardware GPU support.
    1. A sample emulator configuration is shown at (documentation/dev-screen-shots/SampleEmulator.jpg)
  3. IMPORTANT NOTE: the Android emulator runs in a firewall-restricted sandbox that cannot communicate over UDP with outside processes, meaning you cannot send or receive Geomessages (spot reports, etc.) from or to Squad Leader running on an emulator.

Notes on Submodules used by the Repo

Squad Leader leverages the following as submodules of the squad-leader-android repository.

If you should want to update to the latest commit instead of the commit used by the squad-leader-android commit you're using, you can open a GitHub shell in squad-leader-android and run the following:

$ cd .\source\military-apps-library-java $ git pull origin master

User Guide

More information for configuring and running the application see the User Guide

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

See Issues for a list of known issues.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2013 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

Portions of this code use other Esri libraries, also governed by the Apache License:

  • military-apps-library-java

Portions of this code use third-party libraries:

See license-ThirdParty.txt for the details of these licenses.

[](Esri Tags: ArcGIS Defense and Intelligence Military Defense Portal Android) [](Esri Language: Java)

About

The Squad Leader template demonstrates best practices for building handheld military applications with ArcGIS.

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
license.txt
Unknown
license-ThirdParty.txt

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%