Building the Android application - edgenet/drops GitHub Wiki

Prerequisites

Drops requires libsodium, ZeroMQ, CZMQ, Zyre, and libdrops.
See building libdrops for instructions.
If you plan on building from the command line then you'll need to install ant.

sudo apt-get install ant

If you're on a 64-bit system then you'll also need to install 32-bit libraries. If you're on Ubuntu 12.04+ then you can run

sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

If you're on Debian 7 then you'll need to run this, then follow the instruction for Ubuntu (above).

sudo dpkg --add-architecture i386
sudo apt-get update

Setting up the Android developer tools

Downloading

You will need to download the Android SDK and the Android NDK.

You may also want to download the Eclipse IDE to work on the code. Luckily the default option on the Android SDK page is to download the "ADT Bundle", which includes the Android SDK and Eclipse already setup for Android development.
This is optional, so if you just want the Android SDK you should click "USE AN EXISTING IDE" and click download.

When you download the Android NDK make sure you do not accidentally download the legacy toolchains.

Installing

Extract the Android SDK and NDK. For the purposes of this guide we will assume you extracted them to ~/bin/ so that ~/bin/ looks like this:

~/bin/
  android-ndk-r9b/
    build/
    docs/
    platforms/
    ---etc---
  android-sdk-linux/
    add-ons/
    build-tools/
    docs/
    ---etc---

Set your $PATH variable to include android-sdk-linux/platform-tools/, android-sdk-linux/tools/, and android-ndk-r9b/.

From here you can run android found in android-sdk-linux/tools/ or run it from your terminal to launch the SDK GUI. You should download the latest "Android SDK Tools", "Android SDK Platform-tools", "Android SDK Build-tools". You will need to download an "SDK Platform" higher than the version of Android you are running on your device.

You can also do this from the command line but it's a bit more complicated, see the .travis.yml to see how we do this.

Building the Application

Command line

cd ./src/app
android update project -p .
ndk-build
ant debug

Using Eclipse

Open Eclipse and click File --> Import --> Android --> Existing Android Code Into Workspace --> Browse --> drops/src/app --> Finish.
Eclipse will automatically build the application. If it does not press Ctrl+B or Project --> Build Automatically.

Running

Note: if you have a version of Drops installed from the Play Store then you will need to uninstall that before installing your version.

In the bin/ directory you will find Drops_debug.apk or Drops.apk if you used Eclipse, transfer this file to your Android device. You will need to allow applications to be installed from unknown sources. Then open your favourite file manager, navigate to where Drops_debug.apk is, and open it for installation.