Skip to main content
Version: v5


Android 12 Support
If your app targets Android 12, you must use our SDK only on versions 5.10 or superior.

Minimum requirements#

First, check out if you fulfill the SDK minimum requirements.

Minimum Android SDK versionAndroid API 16
Android Support Library v428+
Google Play Services Ads12.+
Google Play Services Location12.+

If your project is using AndroidX you will need to make sure Jetifier is enabled in your file:


Update the top-level build.gradle script of your project to include the Incognia maven repository:

allprojects {  repositories {      maven { url "" }      ...  }}

If your project uses Android Gradle Plugin version 7 or newer, you have to include the Incognia maven repository in the settings.gradle file instead:

dependencyResolutionManagement {    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)    repositories {        maven { url "" }        ...    }}

In your app-level build.gradle file, add the following dependencies.

dependencies {  // Required  implementation ''     // Google Play Services  implementation ''  implementation ''
  // Compatibility with Support Library  implementation 'androidx.legacy:legacy-support-v4:1.0.0'}

After updating your app-level build.gradle, the project must be synced for the changes to take effect.

Update Android manifest#

Add the following <uses-permission> tags inside the <manifest> tag of your AndroidManifest.xml file.

<manifest><!-- Required for connectivity access --><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Required for location services --><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- Improves location accuracy and battery consumption --><uses-permission  android:name=""/><uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<!-- Allows the SDK to restart itself after the device is rebooted --><uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<-- Allows the SDK to collect location data while in background --><uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<!-- Improves location accuracy (optional) --><!-- Request legacy Bluetooth permissions on older devices. --><uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /><uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /><uses-permission android:name="android.permission.BLUETOOTH_SCAN" /><uses-permission android:name="Manifest.permission.BLUETOOTH_CONNECT" /></manifest>

If you are interested, take a look at why we ask for these permissions using the link below.

The config properties semantics are explained here.

Add Incognia's config file to your project#

The Incognia SDK initialization relies on the presence of a inloco.xml file in the main/res/values directory of your project. To access the configuration file, go to My Apps section on Incognia dashboard and download the file.

Initializing the SDK#

Inside the onCreate method of your Application class, insert the following code to initialize the Incognia SDK.

class CustomApplication : Application() {
    override fun onCreate() {        super.onCreate()
        //Initializes the Inloco SDK        InLoco.init(this)    }}
  • For instructions on how to create your own implementation of the Application class, please check the official Android documentation
  • If you intend conditionally initialize the Incognia SDK, please check this section

If the SDK was initialized properly, your Logcat output will contain the following logs.

I/InLocoMedia: In Loco Engage 5.10.0 is runningI/InLocoMedia: In Loco 5.10.0 is runningI/InLocoMedia: Device Installation ID: <YOUR-DEVICE-INSTALLATION-ID>I/InLocoMedia:╔══════════════════════════════════════════════════════════════════════════════════════════╗║                                In Loco Diagnostics                                ║╠══════════════════════════════════════════════════════════════════════════════════════════╣║ Requirements          β•‘ Status β•‘ Troubleshooting                                         ║╔══════════════════════════════════════════════════════════════════════════════════════════╗║ Wifi enabled          β•‘ Yes    β•‘                                                         β•‘β•‘ Location enabled      β•‘ Yes    β•‘                                                         β•‘β•‘ Internet available    β•‘ Yes    β•‘                                                         β•‘β•‘ Permissions granted   β•‘ Yes    β•‘                                                         β•‘β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

The table identifies the main elements required for Incognia to work properly. When a requirement is not met, a description is shown with information regarding what this requirement enables and what must be done for it to be satisfied.


After integrating the SDK, the wizard will wait for an event to be sent in order to validate that the integration was successful.

Request runtime permissions#

The previous step started the Incognia SDK but your application still needs to request the location permissions (i.e., ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION) from the user in order to fully unlock the location capabilities of the SDK.

We recommend that the permissions are requested as shown in the Android documentation.

Without the Manifest.permission.ACCESS_FINE_LOCATION, most features will not be available. It is extremely important that the user is asked for permission and that the app has a relevant reason to do so. If you are targeting Android 12, you also must ask for Manifest.permission.ACCESS_COARSE_LOCATION. Asking for the Manifest.permission.ACCESS_BACKGROUND_LOCATION is optional but greatly recommended.

What's next?#

From here, you can either complete the full integration with our APIs by using the Installation ID or follow the steps to test the Incognia solution with SDK-only integration. In this mode, you will receive access to a dashboard that displays Incognia's risk scores without needing to integrate the APIs.