HERE Android SDK Developer's Guide

PositionSimulator

The class PositionSimulator is a member of com.here.android.mpa.common .

Class Summary

public final class PositionSimulator

extends java.lang.Object

Provides a means to simulate the current device position by injecting Locations read from position log files into Android LocationManager.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in PositionSimulator
Nested Classes

public static final enumeration PositionSimulator.PlaybackError

Playback Errors

Constructor Summary

Table 2. Constructors in PositionSimulator
Constructors

PositionSimulator ()

Create an instance of the PositionSimulator.

Method Summary

Table 3. Methods in PositionSimulator
Methods

public int getCurrentPositionIndex ()

Index of the currently playing GeoPosition from the position log file.

public GeoPosition getPosition (int index)

GeoPosition from the currently playing position log file for the given index.

public int getPositionCount ()

Number of GeoPositions in the currently playing position log file.

public PlaybackError startPlayback (String logFilePath)

Starts play back of a position log file by pushing Test Locations to Android LocationManager.

public void stopPlayback ()

Stops any currently playing position log file.

Class Details

Provides a means to simulate the current device position by injecting Locations read from position log files into Android LocationManager.

Constructor Details

PositionSimulator ()

Create an instance of the PositionSimulator.

Note that you should not attempt to replay position log files concurrently.

Method Details

public int getCurrentPositionIndex ()

Index of the currently playing GeoPosition from the position log file.

Returns:

Position index.

public GeoPosition getPosition (int index)

GeoPosition from the currently playing position log file for the given index.

Parameters:

  • index

    Position index.

Returns:

GeoPosition or null if index is out of bounds.

public int getPositionCount ()

Number of GeoPositions in the currently playing position log file.

Returns:

Position count.

public PlaybackError startPlayback (String logFilePath)

Starts play back of a position log file by pushing Test Locations to Android LocationManager.

Any currently playing file will be immediately stopped and the new position log file started.

When the last Position in the position log file has been played the LocationManager status will be set to unavailable but system GPS updates will not be resumed until stopPlayback() is called.

Position log file playback only works with the default location data source and requires the ACCESS_FINE_LOCATION and OPSTR_MOCK_LOCATION android application permissions.

Parameters:

  • logFilePath

    Fully qualified file path of the position log file.

Returns:

PlaybackError.NONE if play back was started successfully, otherwise the failure reason.

public void stopPlayback ()

Stops any currently playing position log file. System GPS updates will be resumed.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.