This page describes how to add the Threatmetrix SDK to your Android project.
Once you have added the ThreatMetrix files to your project, your application will automatically generate a device fingerprint during initialization.
The sections below describe how to add the ThreatMetrix modules to your Android project. The Overview section describes the process and defines the files you will need to include. The Guide section provides step-by-step instructions for adding the modules to your project and ensuring that your application has the required settings.
Integrating Device Fingerprinting into your application requires creating new modules for the following files that are provided by Threatmetrix:
- TMXProfilingConnections.aar - Handles transferring data to and from the Threatmetrix backend.
- TMXProfiling.aar - Manages the generation of device profiles.
Follow the steps below to add the ThreatMetrix modules to your project:
- Save the ThreatMetrix modules to your local machine: TMXProfiling.aar, and TMXProfilingConnections.aar.
- Open your project in AndroidStudio.
- From the main menu, select File > New > New Module, as shown in the image below:
- On the Create New Module screen, select “Import .JAR/.AAR Package”, as shown in the image below. Then click the Next button.
- Enter the path to the TMXProfiling.aar file. Then click Finish.
- Repeat steps 3, 4, and 5 for the TMXProfilingConnections.aar module.
- Open your settings.gradle file, and confirm that TMXProfiling and TMXProfilingConnections are listed at the top, as shown in the image below. Add the files to the list if they are not already added. TMXBehavioralBiometrics.aar, and TMXDeviceSecurityHealth.aar are not required for this integration.
- Open the app module’s build.gradle file and add a new line to the dependencies block for each module, as shown in the image below. TMXBehavioralBiometrics.aar, and TMXDeviceSecurityHealth.aar are not required for this integration.
- Sync your application.
- Open your AndroidManifest.xml file and add INTERNET permissions to your application, if it is not already added. The image below shows the AndroidManifest.xml with INTERNET permissions added: