Android Mobile Browser Plugin

Android Browser Plugin SDK Documentation

1.0.11Initial version22/07/2022SB
1.2.0Introduced show Earnings feature flag10/08/2022SB
1.3.0Introduced earthmark feature flag06/09/2022SB
1.4.0Updates to include:

- Custom logo
- Logic improvements
1.5.0Fixed an issue causing crash on Android 711/10/2022SB
1.6.0Updates to include:
- Fixed an issue when sharing a web page
- Fixed an issue for deal activation in the wrong brand
- Fixed an issue when the deal popup is shown in domains with no deals
- Fixed an issue that was removing the deal popup when scrolling
1.7.0Fixed an issue on Android 719/10/2022CPI
1.8.0Added cashback configuration28/10/2022CPI
1.9.0Added charity configuration07/11/2022CPI
2.0.0Updates to include:
- Bug fixes
- Added new service status check function
2.2.0Updates to include:
- Settings activation flow more user-friendly
2.3.0Updates to include:
- Spanish, French, German & Korean language support
- Network requests bug-fixes
- Coupons view bug-fixes
2.4.0 Added Kindred Wallet Sign in24/01/2023CPI
2.5.0Updates to include:
- Added logic improvements
2.6.0Updates to include:
- Added UTM parameters for analytics
- Comeback activity bug-fix
2.7.1Updates to include:
- Improved error tracking
- Country/currency re-configuration after service starts is now possible
2.7.2Updates to include:
- Addition of Kindred License Agreement
3.1.0Updates to include:
- New implementation (Maven)
- Logic improvements
- Minor bug-fixes
- Customizable texts of the popups
28/06/2023Updates to include:
- Memory use optimization
- Arabic , Chinese simplified , Chinese traditional , French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Thai, Turkish & Vietnamese language support
- New back button to after deal activation
3.4.0Updates to Include:
- Setting Custom Log Prefix

Getting Started

Follow these instructions to add the Kindred Browser Plugin SDK to an existing application.

For any questions or support with your integration, or to receive your API details, please email [email protected]


The Android Mobile Browser SDK only works on the Chrome Browser. Support for other browsers is coming soon.

  • Instructions contained by "[]" need to be adapted for each application.
  • Instructions contained by "{}" might change on each SDK revision.

Maven Implementation

  1. Edit the app’s module build.gradle file, and add dependencies with the latest version.
// app/build.gradle
  1. Add the file in the root of your project. This will include authentication for Maven repositories and authentication for the Kindred SDK.
    ext {

Github Implementation

  1. First, you need to generate an access token from your account;

    1. From Github, click your user icon, then click on settings.

    2. At the bottom, click Developer Settings

    3. Click on Personal access tokens and then click on Generate new token.

    4. Add a note, select the expiration time, select the checkbox "read:packages" and click to "Generate token"

  2. Add the file in the root of your project. This will include authentication for Maven repositories and authentication for the Kindred SDK.
    Replace the USERNAME with your Github user name and the TOKEN by the code that has been generated in the previous step

ext {
  1. Add the SDK’s and dependencies maven repository to settings.gradle file and make sure you apply the "":
// settings.gradle
apply from: ""

dependencyResolutionManagement {
    repositories {

        // Kindred SDK Dependency
        maven {
            name = "GitHubPackages"
            url = uri("")
            credentials {
              username = kindred_sdk_user
              password = kindred_sdk_secret_key
} = "your_app"
include ':app'
  1. Edit the app’s module build.gradle file, and add dependencies with the latest version.
// app/build.gradle
implementation 'com.kindred.libraries:browser-sdk:{X.X.X}'

Service Configuraiton

  1. Add the Auth Settings to the defaultConfig in the module build.gradle. This is later passed down to the Kindred SDK during configuration. Make sure you apply the "":
// app/build.gradle
apply from: "../"
android {
      defaultConfig {
        buildConfigField("String", "AUTH_CLIENT_ID", "\"" + AUTH_CLIENT_ID + "\"")
        buildConfigField("String", "AUTH_CLIENT_SECRET", "\"" + AUTH_CLIENT_SECRET + "\"")
        buildConfigField("String", "AUTH_SHARED_KEY", "\"" + AUTH_SHARED_KEY + "\"")
  1. Create the Deals Accessibility service class in the app module

Note: find out more about the configuration flags below, in the section Kindred feature configuration

Note: KindredUserConfiguration is deprecated and will be removed in future versions. We suggest the use of the new functions "setUserCountry" & "setUserCurrency" from KidnredFramework.

// DealAccessibilityService.kt

import com.kindred.browser_sdk.KindredAbstractAccessibilityService
import com.kindred.browser_sdk.configuration.*

class DealsAccessibilityService : KindredAbstractAccessibilityService() {

    companion object {
        val kindredApiConfiguration = KindredApiConfiguration(
            clientID = BuildConfig.AUTH_CLIENT_ID,
            clientSecret = BuildConfig.AUTH_CLIENT_SECRET,
            sharedKey = BuildConfig.AUTH_SHARED_KEY

    override fun configureService() = KindredAccessibilityServiceConfiguration(
        api = kindredApiConfiguration,
        user = KindredUserConfiguration(
            userCurrency = "CURRENCY_CODE",
            userCountry = "COUNTRY_CODE"
        features = KindredFeaturesConfiguration(
          showEarningsConfirmationMessage = true,
        	earthMarkScoring = true,
          showCashbackLabel = true
        charity = KindredCharityConfiguration(
            charityId = "CHARITY_ID",
            charityShare = CHARITY_SHARE

    override fun onCreate() {

  1. Setting the user ID (optional)

The default configuration gives each user a unique user ID. If you wish to provide your own user ID or a unique identifier for the user for analytic purposes, you can provide the SDK with you own unique ID as follows:

// DealAccessibilityService.kt
    override fun onCreate() {

  1. Setting a custom icon (optional)

By default, the service will use a Kindred logo but it's possible to set a custom icon by providing the drawable Int in this function:

// DealAccessibilityService.kt
    override fun onCreate() {
  1. Setting an activity to comeback after service activation (optional) (Min Android 7)

You can use this function to set a comeback intent. After the service is activated by the user, they will get returned to the activity if the set intent automatically:

// DealAccessibilityService.kt
    override fun onCreate() {
  1. Add the accessibility service xml file in the res/xml folder.
// accessibilityservice.xml
<accessibility-service xmlns:android=""
  1. Add permissions to the AndroidManifest.xml file
// AndroidManifest.xml
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
  1. Add accessibility service to the AndroidManifest.xml file
// AndroidManifest.xml
                <action android:name="android.accessibilityservice.AccessibilityService" />
                android:resource="@xml/accessibilityservice" />
  1. Add string values to the res/values/strings.xml (Note, you can change these values as applicable)
// strings.xml
    <string name="accessibility_service_description">By allowing the Accessibility Permission, you permit “App Name” to access data about your URLs. We do this to enable you to save money when you are shopping on your favourite brands, coupon codes will pop up at checkout, helping you to save!</string>
    <string name="accessibility_service_label">Kindred</string>
  1. Setting a custom Log prefix (optional)

By default the log message tag in the Logcat will be "kk", you can change this by providing your own custom prefix:

// DealAccessibilityService.kt
    override fun onCreate() {

Kindred Framework

KindredFramework is an object class we expose to facilitate some functionalities related to the service.


This function will return the current status of the service, a boolean indicating if the service is currently running or not.

val serviceStatus = KindredFramework.isAccessibilityServiceEnabled(context)


This function will open the accessibility settings of the service for its activation and will display a toast message with the received text.

KindredFramework.openAccessibilityServiceSettings(context, "INCLUDE YOUR TEXT HERE")

This toast message is a tiny popup at the bottom of the screen and it's centred. It will disappear after a fraction of a second.


This functions wil receive the context, the kindredApiConfiguration companion object that was created in the service and a callback. It will open the wallet sign in web page in the default browser.
The callback will receive one of three states: _SUCCEED, NO_AUTH (No authentication was detected during the process), ERROR (Something else went wrong)

            KindredFramework.openKindredWallet(this, DealsAccessibilityService.kindredApiConfiguration) {
                Log.d("kk", "$it")


This function allows you to override the country code of the initial service configuration or add one if none was specified at the service start.

            KindredFramework.setUserCountry("COUNTRY_CODE", context)


This function allows you to override the currency code of the initial service configuration or add one if none was specified at the service start.

            KindredFramework.setUserCurrency("CURRENCY_CODE", context)


TRANSLATIONS is an object class we expose to facilitate the customization of the strings of the popups shown by the service.
The translations can be customized from anywhere but we suggest to do it in the onCreate of the AccessibilityService class to ensure the new strings set will be used when needed.

How to use it?

class DealsAccessibilityService : KindredAbstractAccessibilityService() {
  override fun onCreate() {
    val stringMap = mapOf<String, String>(
    TRANSLATIONS.setCustomTranslations(context, stringMap)

Customizable strings

BALANCE_CHANGE_TEXT_BODY -> Default: Check out your rewards in the app
COPY_DISCOUNT_CODES_TEXT_BODY -> Default: Copy discount codes below
COPY_TEXT -> Default: Copy
DEAL_ACTIVATED_TEXT_BODY -> Default: Deal Activated
ACTIVATING_DEAL_TEXT_BODY -> Default: We're activating your deal
ACTIVATING_CASHBACK_TEXT_BODY -> Default: e\'re activating your cash back
CLICK_DEAL_TEXT_BODY -> Default: Click deal below
ACTIVATE_ALL_DEALS_TEXT_BUTTON -> Default: Activate all deals
ACTIVATE_DEAL_TEXT_BUTTON -> Default: Activate deal
ACTIVATE_UP_TO_TEXT -> Default: Activate up to CASH_BACK_PLACEHOLDER cash back
ACTIVATE_EARN_TEXT -> Default: Activate & earn as you click
COPIED_TEXT -> Default: Copied!
GO_APP_TEXT_BUTTON -> Default: Go to App
PLANT_TREES_TEXT_BUTTON -> Default: Purchase to plant trees
COUPON_CHECKOUT_TEXT_BUTTON -> Default: Coupon codes available at checkout

Kindred feature configuration

What is "Show Earnings" feature flag?

If you would like us to popup to the user whenever they've made any cash back or donated to a cause, you can set this feature flag on when setting up the configuration on the DealsAccessibilityService.

What is "EarthMark" feature flag?

Earthmark have developed a rating system to show how "green" retailers really are. Earthmark's rating system will now be highlighted within the Kindred technology so partners can help their users make more informed choices to shop sustainably.

What is "Show Cashback label" feature flag?

You can turn on/off the cashback label feature flag. Having it on means that when we detect a cashback deal, the user will be notified through the popups with text indicating how much cashback they would be earning. Having the feature off means that there will not be any reference to cashback or cashback amount instead, will reference a deal.

Feature flag off

Feature flag on

Kindred SDK Size

What's the size of our SDK in your project and APK?

Adding the Kindred SDK to a sample project adds an extra 0.71 MB to the total APK size

Before SDK:

  • Project size: 35.4 MB
  • APK size: 5.25 MB

After SDK:

  • Project size: 46.1 MB
  • APK size: 5.96 MB

License Agreement: