The documentation for the Harbor Lockers API and SDKs can be found here: Harbor Documentation
Before getting started with the SDK, you will need to integrate your backend with the Harbor Backend. This is required to connect and interact with the Harbor Towers.
The Android SDK is distributed through Jitpack. It can be integrated through gradle, maven, sbt, and leiningen as following:
In your root build.gradle
, at the end of repositories, add the following
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then add the dependency
dependencies {
implementation 'com.github.Harbor-Lockers:harbor-android-sdk:<version>'
}
Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Then add the dependency
<dependency>
<groupId>com.github.Harbor-Lockers</groupId>
<artifactId>harbor-android-sdk</artifactId>
<version>version_number</version>
</dependency>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Then add the dependency
libraryDependencies += "com.github.Harbor-Lockers" % "harbor-android-sdk" % "Tag"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Then add the dependency
:dependencies [[com.github.Harbor-Lockers/harbor-android-sdk "Tag"]]
Add the following entries to your AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
The android:required
value in the last line depends on wether you want your app to be listed to users that doesn’t have BLE support on their devices. This might be the case if all your app does is control lockers with Harbor SDK and can’t do anything useful without BLE support.
Since Harbor SDK requires access to the user's location to scan for nearby devices through BLE, you'll need to manually request location permissions to the user in your app. Please refer to the official android documentation on how to request this.
For steps on how to use the SDK to connect and interact with the tower, please refer to the official documentation