This is a fork of MAVLink UDP Example created by Bryan Godbolt, rewritten for Android using JNI. The app sends some data to QGroundControl using the MAVLink protocol.
- Open
local.propertiesand editsdk.dirandndk.dirproperties (paths to your Android SDK and NDK):
ndk.dir=~/Library/Android/android-sdk-linux/ndk-bundle
sdk.dir=~/Library/Android/android-sdk-linux
-
Download: c_library_v2 or generate: generate_libraries MAVLink headers.
-
Open
/mavlink-udp/src/main/cpp/Android.mkand editLOCAL_CFLAGSvariable so that it points to the folder where you keep the headers.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -I ~/mavlink/generated/include
LOCAL_MODULE := mavlink_udp
LOCAL_SRC_FILES := mavlink_udp.c
include $(BUILD_SHARED_LIBRARY)
- If you're having trouble building the project (
The system cannot find the file specified) - try downloading older NDK version.
system_id and component_id values are both set to 1 by default, but can be set by the user.
Latest build of the app can be downloaded here: mavlink-udp-debug.apk.
To establish connection check your Android device's IP address and add target host in QGroundControl:

Start UDP server in the app and it will start sending heartbeat, attitude, location and battery status:

