Asset Tracking

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.

Using the example apps – Android

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

3. Clone the Ably Asset Tracking SDK Android GitHub repo.
4. Open the cloned directory in Android Studio.
5. 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.

6. 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

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

8. Start the route.
9. In the publishing app click ‘+’ to add a trackable.
10. Enter a tracking ID and click Add.
11. Run the subscribing app on an additional device.
12. Enter the tracking ID.
13. The asset will be displayed on the map.

The following screenshot shows the example apps running:


Example apps running

See also


API reference
Documentation