Setup your development

Learn how to integrate the truemetrics Android SDK into your app. The other sections of this document describe in detail how to integrate and use the SDK in your application.

Get your SDK API key

For using the SDK to upload data from the integrating app (e.g. your driver app), an API key is required. The integrating app has to set this api key (called SDK API KEY) in the initialization of the SDK (see also here in the documentation).

If you only want to make some first upload tests, you can use our demo SDK API KEY

MSgcfnGu0p3E2KhFwTP3N5NSrCSXm54U6DI0PW51

How to integrate the SDK for native apps

Clone the demo application

To ensure a smooth integration in your app, we prepared a sample integration with a basic demonstrator just for you. You can find this repository here. Just clone the repository locally, by following these instructions in your terminal.

Just run or deploy the application in your favorite IDE.

Prepare the SDK integration

Integrate the SDK into your app by following these steps:

  1. Read the documentation of the SDK interface.
  2. Think about, when your app requires to initialize the truemetrics SDK. Typically this is done when the integrating App is started.
  3. Think about, when to start and stop the SDK. This could be for example when the driver starts a new delivery or starts with his route. Or it could be just the whole shift of a driver.

How to integrate the SDK for React Native apps

We have also prepared a React Native demo app to show how to integrate our SDK. You can find it here.

There is a native module called TruemetricsSdkModule in the android module of React Native demo app. TruemetricsSdkModule handles interaction with the SDK.

Connect your backend

The second API key (called RESULTS API KEY) is used when you want to receive the results of a delivery from https://api.truemetrics.cloud/V2/results.

If you plan to use all features and to actually receive results, request an API Key by sending us a message. We’ll get back to you as fast as possible.

App permissions

SDK requires location permissions (including background location) to collect fused location data that helps our algorithms provide efficient results. You can refer to Android developers guidelines to integrate location permissions and user consent. Additionally, SDK requires permission to post notifications in order to show Foreground service notification. Demo app showcases creating notification channels and asking for permission to post notifications.

Software Specifications

Android SDK can run on minimum Android 7.0 (API level 24)