Add the Library
Once you have your licence key, follow these steps to add the DeviceAssure Android Library to your project.
System Requirements
Before you begin, ensure your project meets the following requirements:
| Requirement | Version |
|---|---|
| JDK | 11 or higher |
| Minimum SDK | API v21 (Android 5.0) |
| Target API | 34 |
Step 1: Configure Gradle Repositories
Add the DeviceAssure Maven repository to your project's build.gradle file:
repositories {
mavenCentral()
google()
maven { url "https://java-api.deviceatlas.com/<LICENCE_KEY>/" }
}
Replace <LICENCE_KEY> with your DeviceAssure licence key.
Step 2: Add the Dependency
Add the DeviceAssure library dependency to your app's build.gradle file:
Step 3: Permissions
The DeviceAssure library utilises the DeviceInfo library as a dependency, which defines the following permissions in its manifest. These are automatically merged into your application:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
These permissions can be overridden by your host application if needed.
Permission Details
| Permission | Purpose |
|---|---|
INTERNET | Required to send collected data to the DeviceAssure service |
ACCESS_NETWORK_STATE | Required to check network connectivity |
READ_PHONE_STATE | Optional but required to obtain TAC and Manufacturer Code on Android 9 (API 28) and lower. For Android 10 (API 29) and higher, TAC and Manufacturer Code will be collected without requiring this permission. |
Note: The TAC (Type Allocation Code) is a non-PII property that identifies the make and model of the device and is used to validate the device. Omitting this permission may result in an incomplete validation.
See Also
- Basic Integration - Integrate DeviceAssure into your application
- Client to Server - Direct validation from the app
- Server to Server - Validation via your backend server