Navigation auto pan mode in Android emulator (100.0.0)

1225
2
01-25-2017 06:04 AM
HenrikPierrou
New Contributor II

Hi,


I'm porting an iOS app using ArcGIS Runtime 10.2.5 to Android, using the 100.0.0 runtime version. The app relies on the navigation auto pan mode to have the location display always point up and the underlying map rotate so that the direction of travel is displayed. During the development of the iOS version of the app I could set a GPXDataSource to the location display to simulate movement. With every new location the location display was moved and the map rotated.

With the new Android runtime there is no GPXDataSource (the only known subclass to LocationDataSource is the default AndroidLocationDataSource) and loading emulated movement in the form of a GPX file into the emulator gives no course or velocity in the LocationChangedEvents Location object.

How can I get the navigation auto pan mode behaviour in the emulator? Do I need to build my own LocationDataSource?

0 Kudos
2 Replies
ShellyGill1
Esri Contributor

Hi Henrik,

Although you can use the functionality built in to the Android Emulator to mock locations using a GPX file (Run Apps on the Android Emulator | Android Studio ), I don't think this sends through compass heading (bearing / course) or velocity (speed) information. So the recentering behaviour would work, but the map/symbol rotation aspects would not work. Looking at the emulator geo fix command, I don't think there's a way to script this sort of information for the emulator.

If you can find a 3rd party mock location app in the Play Store that provides this information, then you could try to install the Google Play store on your emulator (you can find more info if you search on Stack Overflow for android emulator Play Store GAPPS), and install the location mock app.  Alternatives would be to create a custom data source, as you suggest, and ensure that the locations are created to include the bearing and speed information you want. In some Runtime SDKs I think there is/was a built-in mock location provider, based on a standard platform technology. We don't have this for Android runtime SDK, 10.x or 100.0. It is something that has been suggested as an enhancement, but I don't know when/if that would be made available. Submitting this to ArcGIS Ideas  would be a good way to note your interest in this feature.

Regards

Shelly

0 Kudos
HenrikPierrou
New Contributor II

Hi Shelly,

Thank you for your response! Yes, mock locations from the emulator get through to the location display but the course and velocity are not set on the received Location objects. In the iOS 10.2.5 runtime SDK, a location data source was included to provide mock locations from GPX files that did include this information and I would hope this will be included for Android in the future. For now I ended up writing my own location data source that sets velocity and course based on the previous and current locations.

Regards

Henrik

0 Kudos