OpenHAB is an open source home automation project. It comes with an Android application to enable users to control OpenHab from their Android devices. In this post we will show the steps to setup the development environment in mac and also go through the steps to build and run the app on an Android phone.
The github and information for the Android project can be found here.
First we will need to download and install Android Studio, which is an official IDE in replacement of Eclipse+ADT approach. The Android Studio download page is located here.
After the installation of Android studio we will launch Android studio and install Android SDK version 4.0.3.
Choose ‘SDK Manager’, and select ‘Android 4.0.3’ to install the SDK.
Next we will download the latest code from github using (on mac):
$git clone https://github.com/openhab/openhab.android
Then we will use ‘Import project’ selection in Android Studio to import the project under openhab.android. After importing it may complain about missing build tools as below.
Click the ‘Install build tools 20.0.0 and sync project’ to install the missing tools. Please note that this process many iterate several times due to different missing tools.
After all tools are installed we will click the green triangle ,with mobile select, to build and run the app.
Connect an Android phone to the mac and enable USB debug.