> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/home/psdk-peripherals-snapshot/developer-guide/installation.md).

# Installation

Add the PSDK Peripherals library to your Android project in two steps: configure the Maven repository, then declare the dependency.

Use the latest release. Check the [release notes](/home/psdk-peripherals-snapshot/release-notes/release-notes.md) for breaking changes before upgrading — the API is unstable before version 1.0, and minor version bumps may include breaking changes.

## Prerequisites

Your project must meet these minimum versions:

| Requirement           | Minimum |
| --------------------- | ------- |
| minSdk                | 30      |
| compileSdk            | 34      |
| Android Gradle Plugin | 8.1.0   |
| Kotlin                | 2.1     |
| Coroutines            | 1.10.2  |

Newer versions of any of these are supported — the table lists the oldest that is tested. The library declares these minimums in its own metadata, so a project below them fails the build with a message naming the requirement rather than an obscure error.

Minimum versions can change between releases. Check the [release notes](/home/psdk-peripherals-snapshot/release-notes/release-notes.md) before upgrading.

You also need:

* `android.permission.CAMERA` in your app's manifest.
* A Verifone terminal with a camera, running VA/OS 6.x, 7.x, or 8.x.
* Access to one of the Maven repository options below (Verifone Artifactory, GitHub Packages, or local).

## Add the library

{% stepper %}
{% step %}

### Configure the repository

In your project's `settings.gradle.kts`, add the repository that matches your network access:

{% tabs %}
{% tab title="Verifone Artifactory" %}
Verifone internal network only. Local dev: set `MAVEN_USERNAME` and `MAVEN_PASSWORD` in `~/.gradle/gradle.properties` or as environment variables. CI: set them as secrets in your CI environment.

```kotlin
dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://artifactory.verifone.com/artifactory/rd-repositories")
            credentials {
                username = providers.gradleProperty("MAVEN_USERNAME").orNull
                    ?: System.getenv("MAVEN_USERNAME")
                password = providers.gradleProperty("MAVEN_PASSWORD").orNull
                    ?: System.getenv("MAVEN_PASSWORD")
            }
        }
    }
}
```

{% endtab %}

{% tab title="GitHub Packages" %}
Accessible outside the Verifone network. Requires a GitHub account with read access granted by Verifone. Local dev: set `gpr.user` and `gpr.key` in `~/.gradle/gradle.properties`. CI: set `GITHUB_ACTOR` and `GITHUB_TOKEN` as secrets in your CI environment. Use a GitHub Personal Access Token (PAT) with `read:packages` scope.

```kotlin
dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://maven.pkg.github.com/verifone-psdk/artifacts")
            credentials {
                username = providers.gradleProperty("gpr.user").orNull
                    ?: System.getenv("GITHUB_ACTOR")
                password = providers.gradleProperty("gpr.key").orNull
                    ?: System.getenv("GITHUB_TOKEN")
            }
        }
    }
}
```

{% endtab %}

{% tab title="Local Maven" %}
For offline use or when no network access is available.

Download the Maven repository tarball from your version's entry on the [Release Notes](/home/psdk-peripherals-snapshot/release-notes/release-notes.md) page, along with its `.sha256` checksum file where one is listed. Then verify and extract the tarball into your local Maven repository.

Run both steps from the directory containing the downloaded files, with `VERSION` set to the version you downloaded (e.g. `0.6.0`).

If your version lists a `.sha256` file, verify the download first — `OK` means it is intact:

{% tabs %}
{% tab title="Linux" %}

```shell
VERSION=x.y.z
sha256sum -c psdk-peripherals-${VERSION}.tar.gz.sha256
```

{% endtab %}

{% tab title="macOS" %}

```shell
VERSION=x.y.z
shasum -a 256 -c psdk-peripherals-${VERSION}.tar.gz.sha256
```

{% endtab %}

{% tab title="Windows (PowerShell)" %}

```powershell
$VERSION = "x.y.z"
$expected = $null; $actual = $null
$expected = (Get-Content psdk-peripherals-$VERSION.tar.gz.sha256).Split()[0]
$actual = (Get-FileHash -Algorithm SHA256 psdk-peripherals-$VERSION.tar.gz).Hash
if ($expected -and $actual -and $actual -eq $expected) { "OK" } else { "FAILED" }
```

{% endtab %}
{% endtabs %}

If this reports `FAILED`, download the file again; contact Verifone support if it keeps failing.

Then extract with `tar`, which ships with macOS, Linux, and Windows 10 1809 or later:

{% tabs %}
{% tab title="macOS / Linux" %}

```shell
VERSION=x.y.z
mkdir -p ~/.m2/repository
tar -xzf psdk-peripherals-${VERSION}.tar.gz -C ~/.m2/repository
```

{% endtab %}

{% tab title="Windows (PowerShell)" %}

```powershell
$VERSION = "x.y.z"
mkdir -Force "$env:USERPROFILE\.m2\repository" | Out-Null
tar -xzf psdk-peripherals-$VERSION.tar.gz -C "$env:USERPROFILE\.m2\repository"
```

{% endtab %}
{% endtabs %}

Add `mavenLocal()` in `settings.gradle.kts`:

```kotlin
dependencyResolutionManagement {
    repositories {
        mavenLocal()
    }
}
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Add the dependency

In your module's `build.gradle.kts`, add the library:

```kotlin
dependencies {
    implementation("com.verifone.psdk:peripherals-scanner:$VERSION")
}
```

{% endstep %}
{% endstepper %}

## Minification

The library needs no configuration when your app's release build shrinks and obfuscates code. Scanning works with nothing to add or exclude on your side.

## Entry point

`BarcodeScanner` is the entry point:

```kotlin
val scanner = BarcodeScanner.create(context)
```

See the [Scanner API](/home/psdk-peripherals-snapshot/developer-guide/scanner.md) guide for how to initialize the scanner and start scanning.

## API stability

{% hint style="warning" %}
This API is unstable and subject to change. Enhancements before version `1.0` may break backwards compatibility.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/home/psdk-peripherals-snapshot/developer-guide/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
