Installation
How to install Beacon Android SDK
To add Beacon Android SDK into your project:
- Make sure the JitPack repository is included in your root
build.gradle
file:
- Groovy
- Kotlin
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
allprojects {
repositories {
...
maven("https://jitpack.io")
}
}
- Add the dependencies:
- Groovy
- Kotlin
dependencies {
def beacon_version = "x.y.z"
// REQUIRED, :core
implementation "com.github.airgap-it.beacon-android-sdk:core:$beacon_version"
// optional, :client-wallet
implementation "com.github.airgap-it.beacon-android-sdk:client-wallet:$beacon_version"
// optional, :client-wallet-compat
implementation "com.github.airgap-it.beacon-android-sdk:client-wallet-compat:$beacon_version"
// optional, :blockchain-substrate
implementation "com.github.airgap-it.beacon-android-sdk:blockchain-substrate:$beacon_version"
// optional, :blockchain-tezos
implementation "com.github.airgap-it.beacon-android-sdk:blockchain-tezos:$beacon_version"
// optional, :transport-p2p-matrix
implementation "com.github.airgap-it.beacon-android-sdk:transport-p2p-matrix:$beacon_version"
---
// alternatively, all modules
implementation "com.github.airgap-it:beacon-android-sdk:$beacon_version"
}
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.
Module | Description | Dependencies | Required by |
---|---|---|---|
:core | Base 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.
Module | Description | Dependencies | Required by |
---|---|---|---|
:client-wallet | Beacon implementation for wallets | :core | :client-wallet-compat |
:client-wallet-compat | Provides a supplementary interface for :client-wallet for use without Coroutines | :core :client-wallet | ✖️ |
Blockchain
Blockchain modules provide support for different blockchains.
Module | Description | Dependencies | Required by |
---|---|---|---|
:blockchain-substrate | Substrate specific components | :core | ✖️ |
:blockchain-tezos | Tezos specific components | :core | ✖️ |
Transport
Transport modules provide various interfaces used to establish connection between Beacon clients.
Module | Description | Dependencies | Required by |
---|---|---|---|
:transport-p2p-matrix | Beacon 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 thenet.java.dev.jna
group from the Beacon dependencies.
- Groovy
- Kotlin
def withoutJna = { exclude group: "net.java.dev.jna" }
implementation "com.github.airgap-it.beacon-android-sdk:core:$beacon_version", withoutJna
implementation "com.github.airgap-it.beacon-android-sdk:client-wallet:$beacon_version", withoutJna
...
def jna_version = "x.y.z"
implementation "net.java.dev.jna:jna:$jna_version@aar"
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")