# Installing the Freshpaint Android SDK

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

```groovy
implementation 'io.freshpaint.android:freshpaint:2.0.4'
```

To import the SDK, use:

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

Then to initialize the SDK, you should run:

```java
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](https://app.freshpaint.io/sources).

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](https://app.freshpaint.io/events/liveview). After opening your app, you should see an `Application Opened` event show up in Live View:

![](https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MA7aDqsXMFbUsWVqonF%2F-MQT2P7kPVThjXx36U70%2F-MQTFujhym67mQlXhxP9%2Fimage.png?alt=media\&token=d5c86e55-bff8-4e23-bd44-c89184142400)

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