Skip to content

Your organisations mapping app built with the runtime SDK for android

License

Notifications You must be signed in to change notification settings

GeoEngTechEL/maps-app-android

 
 

Repository files navigation

Maps-App Android

This repo provides an example app for Android devices called Maps App that can be used as a starter for your organizations mapping app built with ArcGIS Runtime SDK for Android. You can use the Maps App as is, or extend it using the ArcGIS Runtime SDK for Android.

Visit Esri's example app site to read more about this app and how the Runtime features are implemented. Join our GeoNet community and keep up to date on the latest discussions about example-apps!

Features

  • Dynamically switch basemaps
  • Place search
  • Routing
  • Geocode addresses
  • Reverse geocode
  • Sign into an ArcGIS account

Development Instructions

This Maps App repo is an Android Studio Project and App Module that can be directly cloned and imported into Android Studio. In addition, you'll need to follow the steps below to obtain your client id and redirect uri. Both are required for leveraging all the features of the app.

  • Once you've registered your version of the maps-app, grab a copy of the client id from the registration and set the client id in the applications app_settings.xml file.
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- TODO: add your OAuth Client ID here-->
    <string name="client_id">YOUR_CLIENT_ID</string>
    <!-- This redirect URI is the default value for https://www.arcgis.com -->
    <string name="redirect_uri">my-ags-app://auth</string>
    <!-- The following values are used in the Robotium tests only -->
    <string name="username">YOUR_PORTAL_USERNAME</string>
    <string name="password">YOUR_PORTAL_PASSWORD</string>
    <string name="testPartialName">vo</string>
</resources>
  • As part of the registration process, add a redirect uri for your app. Navigate to the Redirect URIs section at the bottom of the registration page and set the redirect uri to my-ags-app://auth. This redirect uri is the default redirect for https://www.arcgis.com.

  • Note that the scheme for the DefaultOAuthIntentReceiver in the Android Manifest file is derived from the redirect uri.
        <activity
            android:name="com.esri.arcgisruntime.security.DefaultOAuthIntentReceiver"
            android:label="OAuthIntentReceiver"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data android:scheme="my-ags-app"/>
            </intent-filter>
        </activity>

Fork the repo

Fork the Maps App Android repo

Clone the repo

Once you have forked the repo, you can make a clone

Command line Git

  1. Clone the Maps App repo
  2. cd into the maps-app-android folder
  3. Make your changes and create a pull request

Configuring a Remote for a Fork

If you make changes in the fork and would like to sync those changes with the upstream repository, you must first configure the remote. This will be required when you have created local branches and would like to make a pull request to your upstream branch.

  1. In the Terminal (for Mac users) or command prompt (fow Windows and Linus users) type git remote -v to list the current configured remote repo for your fork.
  2. git remote add upstream https://github.com/Esri/maps-app-android.git to specify new remote upstream repository that will be synced with the fork. You can type git remote -v to verify the new upstream.

If there are changes made in the Original repository, you can sync the fork to keep it updated with upstream repository.

  1. In the terminal, change the current working directory to your local project
  2. Type git fetch upstream to fetch the commits from the upstream repository
  3. git checkout master to checkout your fork's local master branch.
  4. git merge upstream/master to sync your local master' branch with upstream/master`. Note: Your local changes will be retained and your fork's master branch will be in sync with the upstream repository.

Testing With Robotium

The project includes a small suite of Robotium tests that test various features of the application. The Robotium tests for the maps-app will run best on an attached device, rather than in the emulator. You will need to adjust the values in the app_settings.xml file to reflect your specific auth credentials and any local addresses the tests use. Use the following steps to configure your environment for running the tests.

  1. Attach a non-emulated Android device to your computer.
  2. Ensure location services are enabled on the Android device.
  3. Ensure you have internet connectivity on the Android device.
  4. Change the following entries in your values/app_settings.xml (username, password, testPartialName, localAddressNearYou).
  5. Right-click on the MapAppRobotiumTests.java file in Android Studio and select Run 'MapAppRobotiumTests'.

Requirements

Resources

Issues

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

Contributing

Anyone and everyone is welcome to contribute. We do accept pull requests.

  1. Get involved
  2. Report issues
  3. Contribute code
  4. Improve documentation

Licensing

Copyright 2016 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.

For information about licensing your deployed app, see License your app.

[](Esri Tags: ArcGIS Android Mobile) [](Esri Language: Java)​

About

Your organisations mapping app built with the runtime SDK for android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%