Android SDK-Device Fingerprint

Integrate the SDK into your project

  1. Import DeviceFingerprint.aar

  2. Compile Options Make sure the app's build.gradle file contains the following code snippet within android section (starting from Android Studio 4.1 this snippet is present when creating a new project):

    compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
    }
  3. Permissions

    The SDK uses following permissions,make sure your app got the permissions before start

    android.permission.INTERNET
  4. Init, start and get result

    deviceFingerprint?.setAccessToken(Config.accessToken)
    deviceFingerprint?.setMarket(Config.market)
    deviceFingerprint?.start() { success, dfpId, detailMsg ->
        showLoading(false)
        if (success) {
            tv_result.text = dfpId
        } else {
            tv_result.text = detailMsg
        }
    }
    
    If it is successful, A dfpId will be returned, which can be used to query the the corresponding result from server.
  5. Finalize

    deviceFingerprint?.release()