Install and build GroundSdk#

Environment setup#

Linux#

Ground SDK Android has been tested on Ubuntu 18.04. You should adapt some commands to your Linux distribution.

Download the latest Android Studio, and unpack it to /opt

Note

Ground SDK has been successfully tested with Android Studio 3.4

Follow the installation instructions for Linux, which include downloading Android SDK components.

Download Android NDK Revision 17c for Linux, and unpack it to /opt

Note

Ground SDK will not build with newer NDK revisions. That’s why you should not install NDK from Android Studio SDK Manager.

Note that you can still have several NDK revisions installed on your computer, you just have to reference the 17c revision as described below.

Permanently set environment variables (this will modify your ~/.profile file) with the following commands

$ echo export JAVA_HOME=/opt/android-studio/jre >> ~/.profile
$ echo export ANDROID_HOME=~/Android/Sdk >> ~/.profile
$ echo export ANDROID_SDK_PATH=~/Android/Sdk >> ~/.profile
$ echo export ANDROID_NDK_PATH=/opt/android-ndk-r17c >> ~/.profile

Note

You should use the Android Studio embedded JDK as shown in this example.

You can find the default Android SDK path in Android Studio settings, in Appearance & Behavior > System Settings > Android SDK

Reload the .profile file to take your changes into account

$ . ~/.profile

Install the required tools

$ sudo apt install git python python3 make pkg-config

Install the Repo tool

  • Download it from Google APIs

  • Put it in a directory that is included in your path

  • Make it executable with chmod a+x repo

Configure git with your real name and email address

$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"

You’re ready to clone the GroundSdk workspace.

Mac OS#

Ground SDK Android has been tested on macOS 10.14.4 Mojave.

Download the latest Android Studio

Note

Ground SDK has been successfully tested with Android Studio 3.4

Follow the installation instructions for Mac, which include downloading Android SDK components.

Download Android NDK Revision 17c for Mac, and copy the unpacked android-ndk-r17c directory to /usr/local

Note

Ground SDK will not build with newer NDK revisions. That’s why you should not install NDK from Android Studio SDK Manager.

Note that you can still have several NDK revisions installed on your computer, you just have to reference the 17c revision as described below.

Permanently set environment variables (this will modify your ~/.bash_profile file) with the following commands

$ echo export JAVA_HOME=\"/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home\" >> ~/.bash_profile
$ echo export ANDROID_HOME=~/Library/Android/sdk >> ~/.bash_profile
$ echo export ANDROID_SDK_PATH=~/Library/Android/sdk >> ~/.bash_profile
$ echo export ANDROID_NDK_PATH=/usr/local/android-ndk-r17c >> ~/.bash_profile

Note

You should use the Android Studio embedded JDK as shown in this example.

You can find the default Android SDK path in Android Studio settings, in Appearance & Behavior > System Settings > Android SDK

Reload the .bash_profile file to take your changes into account

$ . ~/.bash_profile

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the required tools using Homebrew

$ brew install git repo python3 pkgconfig

Configure git with your real name and email address

$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"

Clone the GroundSdk workspace#

Create your working directory

$ mkdir groundsdk
$ cd groundsdk

Initialize Repo in your working directory

$ repo init -u https://github.com/Parrot-Developers/groundsdk-manifest

Note

You can learn how to use Repo on the Repo command reference page

Download the GroundSdk source tree

$ repo sync

Build GroundSdk#

Type the following command to build Ground SDK for Android, including the Demo application

$ ./build.sh -p groundsdk-android -t build -j

Note

You can run ./build.sh --help to learn more about the building options

Run GroundSdk Demo#

  1. Launch Android Studio (on Linux, run /opt/android-studio/bin/studio.sh)

  2. Click on “Open an existing Android Studio project”

  3. Select the groundsdk/groundsdk-android directory and click OK / Open

  4. Connect an Android device to your computer

  5. Run groundsdkdemo application

Connect to your drone#

  1. Switch on your drone

  2. Open wifi settings on your Android device

  3. Select your drone’s wifi access point (e.g. ANAFI-xxxxxxx)

  4. Open GroundSdk Demo app

  5. Select the DRONES tab

  6. Your drone should appear in the list, select it

  7. Click on CONNECT

GroundSdk Demo