Using the example apps

Asset Tracking SDK repositories provide example apps for subscribing and publishing. You can test out the sample apps using the emulator provided with the developer tools for your platform.

The following procedure uses Android Studio by way of example, you can also use other tools such as Gradle.

  1. Download and install Android Studio, if not already available on your development system.
  2. Make sure Android SDK build tools are installed. You’ll need to accept the licenses.

Installed SDK build tools

  1. Clone the Ably Asset Tracking SDK Android GitHub repo.
  2. Open the cloned directory in Android Studio.
  3. From the drop-down menu in Android Studio, select the app to run: publishing-example-app and a device to run it on, then click Run.

Select the publishing app

The app builds and the emulator is displayed. It takes a while to boot up.

  1. By default the location source that the app will use for updates is set to phone. Using the Settings button in the app you can also select an Ably channel, or an S3 file as the source. The S3 file is a location history file downloaded from AWS S3 that replays the location data.

How to select location source

  1. Assuming you keep the default option, you can then create a simulated route in the Extended controls. In the emulator, use the Extended controls to create a route. This route is the simulated route that the publisher (asset) will follow.

Extended controls

  1. Start the route.
  2. In the publishing app click ‘+’ to add a trackable.
  3. Enter a tracking ID and click Add.
  4. Run the subscribing app on an additional device.
  5. Enter the tracking ID.
  6. The asset will be displayed on the map.

The following screenshot shows the example apps running:

Example apps running

Using the example apps