Android/Kotlin

Environment Set-up

Overview

In order to build an Android app that uses HAT APIs you first need to install the HAT API Android library from github. To do so you can either manually download the library and add it to your project or you can use maven [link coming soon].

Requirements

  • Android studio 3.2
  • Kotlin 1.3
  • This guide does not show you how to set up the UI; you have to be able to design a basic UI in order to make everything work.

Install manually

To manually install the library you have to download the repo from github and add it to your project via drag n drop.

Install via Gradle

Step 1

In the top-level gradle file, add the jitpack repository link
1
allprojects {
2
repositories {
3
maven { url "https://jitpack.io" }
4
}
5
}
Copied!

Step 2

In your app level gradle file , implement the library dependency
1
implementation 'com.hubofallthings.android.hatApi:hat:<latest-version>'
Copied!

Step 3

Sync the project to download the library.

Step 4

Add internet permission into the AndroidManifest
1
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
package="com.hubofallthings.myProject">
3
/>​
Copied!