# Android SDK

The Android SDK (Software Development Kit) is a collection of software tools and use to create applications for the Android operating system.

## Features

**Simplified Security**: We make it simple for you to collect sensitive data such as device information of users.

## Android Requirements

This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:

* Use Android 6.0 (API level 23) and above.
* Use Kotlin version 1.6.10 and above:  **example ext.kotlin\_version = '1.6.10'**
* Using an up-to-date Android gradle build tools version and an up-to-date gradle version accordingly.

### Step 1 - Add Dependency

Add the dependency in the app level build.gradle&#x20;

```
dependencies {
            implementation 'io.tutelar.android:0.0.2'
    }
```

### Step 2 - Initialize SDK

Add the following line of code to initialise it with the api key you obtained from the Tutelar client panel. If you don’t have an api key, create a new one.

<pre><code><strong>Tutelar tutelar = new Tutelar(context, "YOUR API KEY");
</strong></code></pre>

### Step 3 - Implement Listener

Set and Implement our listener to receive the device details.

```
public class DemoActivity extends AppCompatActivity implements TutelarListener {
    @Override
    public void onSuccess(String data) {
        // Success Callback
    }

    @Override
    public void onFailure(String message) {
        // Failure Callback
    }
}
```

### Step 4 - Getting Device Info

By passing the listener, call the following function to receive the device info shown below

<pre><code><strong>tutelar.getDeviceDetails(this);
</strong></code></pre>

### Step 5 - Proguard Rules (optional)

The Proguard rules are already included in the SDK, If you encounter a problem when using Proguard use.&#x20;

```
-keep, allowobfuscation, allowshrinking interface retrofit2.Call 
 -keep, allowobfuscation, allowshrinking class retrofit2.Response 
 -keep, allowobfuscation, allowshrinking class kotlin.coroutines.** { *; }
 -dontwarn io.tutelar.**
 -keep class io.tutelar.** {*;}
```

### Sample Device Fingerprint Data

```json
{
        "status": true,
        "device": {
            "deviceId": "7edb5cf527d4b8b9",
            "platform": "a32x",
            "is_real_device": true,
            "deviceCharging": false,
            "batteryLevel": "61",
            "devicePixelRatio": "720 x 1457",
            "screenWidth": "720",
            "screenHeight": "1457",
            "touchSupport": true,
            "deviceMemory": "5.81 GB",
            "os": "Android TIRAMISU",
            "deviceTypes": {
                "isMobile": true,
                "isDesktop": false,
                "isLinux": false,
                "isLinux64": false,
                "isMac": false,
                "isSmartTV": false,
                "isTablet": false,
                "isWindows": false,
                "isiPad": false,
                "isiPhone": false,
                "isiPod": false
            },
            "displayResolution": "720 x 1457",
            "audioHardware": {
                "hasSpeakers": true
            },
            "microPhoneHardware": {
                "hasMicrophone": true
            },
            "videoHardware": {
                "hasWebCam": true
            },
            "android_id": "TP1A.220624.014",
            "board": "a32x",
            "brand": "samsung",
            "display": "TP1A.220624.014.M326BDDU4CVK1",
            "boot_loader": "M326BDDU4CVK1",
            "finger_print": "samsung/a32xins/a32x:13/TP1A.220624.014/M326BDDU4CVK1:user/release-keys",
            "hardware": "mt6853",
            "host": "SWDK3808",
            "manufacturer": "samsung",
            "model": "SM-M326B",
            "product": "a32xins",
            "user": "dpi",
            "type": "user",
            "is_emulator": false,
            "ip_address": "172.18.24.158",
            "imei_number": "",
            "data_enabled": "",
            "serial_number": "",
            "network_type": "",
            "data_roaming": "",
            "root_status": false,
            "memory_information": {
                "total_memory": "5.81 GB",
                "available_memory": "3.40 GB",
                "used_memory": "2.41 GB"
            },
            "kernel_version": "4.14.186-25331340",
            "proximity_sensor": {
                "id": 0,
                "is_dynamic_sensor": false,
                "is_wakeup_sensor": true,
                "name": "Ear Hover Proximity Lite Sensor (ProToS Lite)",
                "resolution": 1.0,
                "type": 8,
                "string_type": "android.sensor.proximity",
                "reporting_mode": 1,
                "vendor": "Samsung Electronics.",
                "version": 1,
                "power": 0.75,
                "max_delay": 0,
                "min_delay": 0,
                "maximum_range": 5.0
            },
            "language_info": {
                "language": "en",
                "display_language": "English",
                "iso_3_language": "eng"
            },
            "country_info": {
                "country": "GB",
                "display_country": "United Kingdom",
                "iso_3_country": "GBR"
            },
            "system_storage": {
                "total": "4.73 GB",
                "used": "4.72 GB"
            },
            "external_storage": {},
            "screen_brightness": "193",
            "screen_size": "6.039358293217227",
            "developer_mode_enabled": true,
            "timestamp": 1673075519729,
            "timezone": "Asia/Kolkata",
            "deviceHash": "a7a67efe4ecaf181abfa181a7bad61d0"
        },
        "time": {
            "timestamp": 1673075519731,
            "timezone": "Asia/Kolkata"
        }
    }

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tutelar.io/tutelar-api-document/mobile-sdk-integrations/android-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
