Table of Contents

This page has deprecated and will be archived. Please go to https://www.bitcraze.io/.

Android client architecture

This should give a rough overview over the current state of the Android client architecture and also an outlook on what's planned in future versions.

Current architecture

Main screen

As in every Android application there is a MainActivity class. It is the heart of the application. It defines the main screen which is used when controlling the Crazyflie.

The main screen currently consists of two parts:

Preferences

The preferences (PreferencesActivity) can be accessed from the main screen.

It has the following structure:

Controls

The IController interface defines the basic methods that every controller implementation should support like getting values for thrust, roll, pitch, yaw and enabling/disabling the controller.

Currently the following controllers are implemented:

The touch controller (TouchController) uses the onscreen controls. Unfortunately it is the most difficult way to control the Crazyflie because there is no haptic feedback.

The gyroscope controller (GyroscopeController) is a subclass of the touch controller. It uses the gyroscope/accelerometer sensors to control roll and pitch values.
It would be possible to also control yaw and thrust with the sensors, but it is not really a senseful and reliable way to control the Crazyflie.

The gamepad controller (GamepadController) deals with gamepads or joysticks (like a PS3 or XBox controller). The mapping of the axes and buttons can be changed in the preferences (Controller settings → Gamepad axis and button mapping).

Crazyflie library

One of the main goals of the design is to separate the UI from the Crazyflie library. Currently the crazyflielib (se.bitcraze.crazyflielib package) is still included in the Android client.
In the future, a standalone Java library, that does not contain any Android specific code, should be used instead.

Future plans