Installing the Freshpaint Android SDK

To install the Freshpaint Android SDK, first add the following dependencies to your gradle file:

implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
implementation 'io.freshpaint.android:freshpaint:1.2.1'

To import the SDK, use:

import io.freshpaint.android.Freshpaint;
import io.freshpaint.android.Properties;

Then to initialize the SDK, you should run:

Freshpaint freshpaint = new Freshpaint.Builder(getApplicationContext(), "<your environment id>")
    .trackApplicationLifecycleEvents()
    .recordScreenViews()
    .build();

Freshpaint.setSingletonInstance(freshpaint);

You can get your environment id from the Freshpaint sources page.

You should run the initialization code in either the onCreate method of your class that extends Application, or in the onCreate method of your main activity class.

Verifying Your Instrumentation

To verify your Freshpaint installation, navigate to the Freshpaint Live View. After opening your app, you should see an Application Opened event show up in Live View:

Note, the Freshpaint SDK batches events, so it can take a minute for the event to show up.

Last updated