Skip to content

Pointzi (AndroidX) Setup

You can find an example of integration here

Prerequisites

  1. Your App must be targeted for at least Lollipop (21) and above;
  2. Your app’s compileSdkVersion must be set to 28 or higher
  3. Pointzi v2 uses AndroidX, so your app must use AndroidX as well (Migration instructions).

    This version of Pointzi is recommended for all apps using AndroidX that don't specifically need Android v19-v21, if you need to support versions 19-21 please go to Pointz Legacy.

  4. Pointzi uses Java 1.8 features, please make sure your app uses it as well:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    android {
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        kotlinOptions {
            jvmTarget = "1.8"
        }
    }
    
  5. Pointzi UI is based on Google's Material Components library. Please ensure your app's theme inherits from Theme.MaterialComponents or its subthemes.

You need to make sure that inside your app/res/values/styles.xml (or equivalent) the parent of AppTheme is part of the Theme.MaterialComponents theme. Here is an example from the Wikipedia's app:

1
2
3
4
5
6
   <style name="BaseAppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> 
        <...>
    </style>
    <style name="AppTheme" parent="BaseAppTheme">
        <...>
    </style>

(If you are having issues with this please check instructions here, specially step 4)

Step 1 - Adding Pointzi to your gradle files

These are the two gradle files we need you to make changes

Step 2 - Project level build.gradle

Please add the Pointzi repository to your build.gradle

1
2
3
4
5
6
7
allprojects {
    repositories {
        maven {
            url "https://repo.pointzi.com/sdk/pointzi/"
        }
    }
}

Step 3 - Module (app) level build.gradle

This will link the Pointzi SDK with your app.

You need to add this either to the root of your app's build.gradle or under the android {} task

1
2
3
dependencies {
    implementation (group: "com.pointzi", name: "pointzi", version: "2.+")
}

Integrating Pointzi to your app

Set your Pointzi AppKey in your AndroidManifest.xml file

Under the application tag, add the following meta-data tag replacing APP_KEY with your app key:

1
2
3
4
5
6
7
    <application
        android:name=".MainApplication">

        <meta-data
            android:name="com.pointzi.APP_KEY"
            android:value="APP_KEY" />
    </application>

Identifying your users

At this point Pointzi is fully integrated on you app, but to make it easier to identify your users and use the full capabilities of the Pointzi SDK you can use the following method at any part of your code after performing the integration.

Java:

1
Pointzi.setUserId("BestUserEver#24");

Kotlin:

1
Pointzi.setUserId("BestUserEver#24")