Skip to main content

Installation

How to install Beacon Android SDK

To add Beacon Android SDK into your project:

  1. Make sure the JitPack repository is included in your root build.gradle file:
allprojects {
repositories {
...
maven("https://jitpack.io")
}
}
  1. Add the dependencies:

stable latest

dependencies {
val beaconVersion = "x.y.z"

// REQUIRED, core
implementation("com.github.airgap-it.beacon-android-sdk:core:$beaconVersion")

// optional, client-wallet
implementation("com.github.airgap-it.beacon-android-sdk:client-wallet:$beaconVersion")
// optional, client-wallet-compat
implementation("com.github.airgap-it.beacon-android-sdk:client-wallet-compat:$beaconVersion")

// optional, blockchain-substrate
implementation("com.github.airgap-it.beacon-android-sdk:blockchain-substrate:$beaconVersion")
// optional, blockchain-tezos
implementation("com.github.airgap-it.beacon-android-sdk:blockchain-tezos:$beaconVersion")

// optional, transport-p2p-matrix
implementation("com.github.airgap-it.beacon-android-sdk:transport-p2p-matrix:$beaconVersion")

---

// alternatively, all modules
implementation("com.github.airgap-it:beacon-android-sdk:$beaconVersion")
}

Modules Overview

The library modules and their relations are described below.

Core

Core modules are the basis for other modules. They are required for the SDK to work as expected.

ModuleDescriptionDependenciesRequired by
:coreBase for other modules✖️:client-wallet
:client-wallet-compat

:blockchain-substrate
:blockchain-tezos

:transport-p2p-matrix

Client

Client modules ship with Beacon implementations for different parts of the network.

ModuleDescriptionDependenciesRequired by
:client-walletBeacon implementation for wallets:core:client-wallet-compat
:client-wallet-compatProvides a supplementary interface for :client-wallet for use without Coroutines:core
:client-wallet
✖️

Blockchain

Blockchain modules provide support for different blockchains.

ModuleDescriptionDependenciesRequired by
:blockchain-substrateSubstrate specific components:core✖️
:blockchain-tezosTezos specific components:core✖️

Transport

Transport modules provide various interfaces used to establish connection between Beacon clients.

ModuleDescriptionDependenciesRequired by
:transport-p2p-matrixBeacon P2P implementation which uses Matrix for the communication:core✖️

Proguard and R8

Beacon Android SDK internally uses various libraries that may require custom ProGuard rules. If you're using ProGuard or R8, please follow the guides listed below to make sure your app works correctly after obfuscation:

Troubleshooting

See the list of known issues and how to fix them if you run into problems after adding the dependencies:

  • Native library (com/sun/jna/xxxxx/libjnidispatch.so) not found in resource path

    Add the "net.java.dev.jna:jna:x.y.z@aar" dependency and exclude the net.java.dev.jna group from the Beacon dependencies.

fun ModuleDependency.excludeJna(): ModuleDependency = apply {
exclude(group = "net.java.dev.jna")
}

implementation("com.github.airgap-it.beacon-android-sdk:core:$beaconVersion") { withoutJna() }
implementation("com.github.airgap-it.beacon-android-sdk:client-wallet:$beaconVersion") { withoutJna() }
...

val jnaVersion = "x.y.z"

implementation("net.java.dev.jna:jna:$jnaVersion@aar")