Skip to main content

Java SDK

This page has all the information needed to install and setup the BLOOCK's SDK for Java. If you are looking for documentation related to an specific functionality, please refer to it's specific section.

Requirements

To run the SDK for Java you will need:

  • Java version >= 8
  • Gradle or Maven for installing the package
tip

Please refer also to OS support for current operating system requirements

Installation

The Java SDK is available through Gradle or Maven. To install it, you can add the following to the config of your preferred build tool:

implementation 'com.bloock.sdk:bloock-sdk:SDK_VERSION'

tip

To find the latest version available, you can visit the Maven Central page for this library.

Installation (Android)

For Android projects, the installation is a bit different for restrictions in the JNA library for Java, that has an specific version (aar) to work on Android devices.

implementation 'net.java.dev.jna:jna:5.12.1@aar'
implementation('com.bloock.sdk:bloock-sdk:SDK_VERSION') {
exclude group: "net.java.dev.jna", module: "jna"
}

Set up

To start working with most of the functionalities of our SDKs, you will need an API Key. Please, follow the instructions of Create an API Key to get one.

Here's the code needed to properly configure the SDK Client with the API Key:

import com.bloock.sdk.Bloock;

public class Setup {
public static void main(String[] args) throws Exception {
Bloock.apiKey = System.getenv("API_KEY");
}
}