Jul 17, 2024
![Learn to create and customize ATAK plugins, set up the development environment, build a Hello World example, and integrate MavSDK in this hands-on tutorial.](https://framerusercontent.com/images/QgUyq4jHDgISQnJFARZbWPkAds.png)
The Android Team Awareness Kit (ATAK) has revolutionized situational awareness and operational efficiency across various sectors. As a powerful mobile platform, ATAK provides real-time data sharing and collaboration capabilities that are essential for military operations, emergency response, and field operations. In this article, we’ll explore the world of ATAK plugins and how they extend the functionality of this versatile tool. Some basic knowledge of Android app development will be required.
This will be part 1 of a 2 part series. Feel free to follow along with the video from our latest meetup hosted by RIIS President Godfrey Nolan while reading through the tutorial.
What is ATAK?
ATAK, or the Android Team Awareness Kit, is an open-source situational awareness and communication tool designed for both military and civilian use. It offers a range of features including mapping, geospatial capabilities, and communication functionalities. The modular architecture of ATAK allows for customization and extension through plugins, making it adaptable to various operational scenarios.
Originally developed by the U.S. Air Force in the early 2000s, ATAK has evolved into a civilian version known as “ATAK-CIV,” which was released about 5-6 years ago. This open-source nature has led to a thriving ecosystem of developers and users who continually enhance and expand ATAK’s capabilities.
The Power of ATAK Plugins
Plugins are at the heart of ATAK’s extensibility. They allow users to add new features, customize the user interface, or integrate with external systems. This plugin architecture is one of the most appealing aspects of ATAK, as it enables users to tailor the application to their specific needs.
Some key benefits of ATAK plugins include:
Customization: Plugins can be developed to meet the unique requirements of different organizations or operational contexts.
Integration: ATAK can be integrated with various external systems and data sources through plugins.
Enhanced functionality: Plugins can add new tools and capabilities to the base ATAK application.
Core Features
Mapping and Geospatial Capabilities: ATAK supports both online and offline mapping with high-resolution imagery and fast rendering. It can handle various standard formats and allows for collaborative mapping, including points, drawings, and locations of interest.
Communication: The platform facilitates real-time data sharing, including chat, file sharing, photo sharing, video sharing, and streaming. It also supports radio controls and integration, as well as Voice over IP (VoIP) capabilities.
Navigation: ATAK provides tools for navigation, including walking, hiking, driving, and air-ground coordination. It also offers elevation tools, heat maps, computed contour maps, and dynamic profiling.
Situational Awareness: Features like precision targeting, surrounding land formation intelligence, and team emergency beacons enhance situational awareness. Users can mark, share, and track locations, and use network-aware geofences with triggers.
Customization and Extensibility: The modular architecture of ATAK allows for extensive customization through plugins, enabling users to tailor the application to specific operational needs
ATAK Architecture
The Android Team Awareness Kit (ATAK) and its related variants (WinTAK for Windows and iTAK for iOS) are part of a larger TAK ecosystem designed for situational awareness and communication. Here's an overview of the ATAK architecture and how it interacts with other TAK variants:
![](https://framerusercontent.com/images/1SZWIMUFJKz8yW6lEjgBA1jeo0Q.png)
A common setup would potentially include setting up your own network utilizing something like goTenna. Devices are then able to share data between each other on the network regardless of their TAK variant.
![](https://framerusercontent.com/images/jt9M1VeC3FV6zSjZVnZHOKKvQ8.png)
Getting Started with ATAK Plugin Development
Before we get started, you should know, that you don’t need a tak.gov login to get started, but there will be additional benefits if you have one.
If you want to install any existing plugins such as the UAS Plugin Tool for flying drones, you first need to download and install the base ATAK-CIV (Civil Use) application from Google Play. This is the core ATAK app that you need before installing any plugins. You can then install any of the 30 or so plugins on Google Play or tak.gov which are then loaded into the core ATAK-CIV.
![](https://framerusercontent.com/images/WvPuLN4ub2qggOePDR2WSu9Fds0.png)
However, if you want to create your own plugin, then we don’t need ATAK-CIV just yet. We’ll talk about how to deploy our own plugins in Part 2 of this blog.
The Hello World Example Plugin
Let’s take a look at some of the sample plugins to get us started. The Hello World example is not what I’d expect from its name. It’s a comprehensive plugin that shows many of the capabilities of ATAK plugins. The second example plugin the plugintemplate is more of a traditional HelloWorld example.
Download the ATAK SDK from the official GitHub repository. Unzip the SDK and create a “plugins” directory within it. Within the SDK folder from the version you’ve downloaded navigate to atak-civ/plugins or plugin-templates folder. Copy the HelloWorld example in “plugin-examples” into the newly created “plugins” folder.
![](https://framerusercontent.com/images/1RbD26n5inBZ3MmuZ003f8Wbhg.png)
Click on the helloworld
file within it.
![](https://framerusercontent.com/images/P4AWfNEaAw8FyOoAQ363r2bo.png)
It would be nice if you could just launch this and be ready to go, but there’s a couple of things we need to do to get Android Studio to behave and not harass us with error messages.
Go into the
local.properties
file add the SDK directory and any other information seen in the example below that you are missing:
Create debug and release keystores using the keytool command.
For a debug keystore
b. Fore a release keystore
Change Gradle plugin to 4.2.2 and the Gradle version to 6.9.1
![](https://framerusercontent.com/images/YUvRk1uggnoRlHrX42TjyL5gZeY.png)
Update the Gradle version by going to Settings>Build, Execution, Deployment>Build Tools>Gradle to Gradle JDK: 11
![](https://framerusercontent.com/images/cv40tZYWD0Xn7Tp9dfxaYAK7w.png)
Change the build.gradle file at the app level to the following:
Edit the app configuration to work with the plugin. Since plugins don’t launch as standalone apps, you’ll need to modify the configuration to prevent Android Studio from attempting to launch an activity.
![](https://framerusercontent.com/images/FVqXFV32kjCvpVeupu7sD6V44cg.png)
Install the ATAK APK from the SDK, not the one from Google Play. This ensures compatibility with your development environment.
![](https://framerusercontent.com/images/VF2bzkJ8X4iwiLWg5sTkqKrZquM.png)
Change the build variants and change
:app
tocivDebug
![](https://framerusercontent.com/images/GZ7MN2Rshns9El4vz45vmlXXfA.png)
When you try to run the app, most Android devices will try and prevent you from running applications not downloaded from Google Play, so you will probably see the following message.
![](https://framerusercontent.com/images/DrzbtuLngX0EPKkxq59omA6Asc.png)
Click on more details and then Install Anyway
.
![](https://framerusercontent.com/images/ATJDrOQcGdGHliW3keGbM2j5auU.png)
Okay, if all goes well, you should see the following app interface load:
![](https://framerusercontent.com/images/kc6uFUnJzZFldOe9nkwdvvjlj8.png)
Wow, that’s quite the big Hello World example, but it’s kind of nice because it gives you a great overview of the stock capabilities within the the framework. Be sure to have a peek around and get familiar with all of the options.
You can see the work that goes into this beautifully retro layout in the AndroidTacticalAssaultKit-CIV/plugin-examples/helloworld/app/src/main/res/layout/hello_world_layout.xml
file.
We stopped at the largerButton
button because you can sort of get the idea of where this goes.
Each of those buttons need to be attached to a specific activity for them to do anything. You can see where this is happening in the plugin-examples/helloworld/app/src/main/java/com/atakmap/android/helloworld/HelloWorldDropDownReceiver.java
file. For each of these buttons there’s going to be a listener and a function like this one below for the largerButton
:
This is pretty simple. It just says listen for a button click and when you see one resize to full width and half height.
Feel free to poke around and investigate to learn more about ATAK capabilities. The code in the Hello World app includes lots of helpful comments to point you in the right direction.
Creating Your Second ATAK Plugin: Integrating MavSDK
After successfully creating the “Hello World” plugin, let’s move on to a much simpler example that integrates drone functionality using MavSDK. This plugin builds on the pluginTemplate example and will demonstrate how to connect to a MavSDK server and display real-time position data from a drone.
Before we get started, if you are unfamiliar with the MAVSDK, check out our tutorial from last month’s meetup MAVSDK on Android. We will only briefly cover the MAVSDK-specific steps in this tutorial.
Okay, navigate back to the plugins
or plugin-templates
folder and look for the plugintemplate
file. This file functions more like a traditional Hello World example as it is the barebones you will need to build your own. Refer to steps 1 through 8 of the Hello World section for the basic setup. The main files we are going to be concerned with going forward are PluginTemplateDropDownReceiver.java
, PluginTemplateMapComponent.java
and main_layout.xml
.
![](https://framerusercontent.com/images/oFJ5Xx79a9f4rdBZIwCfsz8gOqQ.png)
Creating the User Interface
To keep things simple for our first MAVSDK plugin, we are going to focus on displaying the latitude and longitude of our drone. First let’s set up a simple layout in our main_layout.xml
Integrating MavSDK
Modern Android applications are rarely coded in Java anymore. The good news is you can easily convert your Java code to Kotlin within Android Studio by going to Code > Convert Java File to Kotlin File. This is great, because we can easily transmute the code in PluginTemplateDropDownReceiver.java
into a PluginTemplateDropDownReceiver.kt
file.
We are going to add the following code between our private val templateView
and our public override fun disposeImpl()
to inject our position coordinates into the layout.
Now we can do the same conversion to our PluginTemplateMapComponent.java
file.
First, let’s add a few variables for our position data just under private var ddr
:
Then we need to add position to the ddr variable within the override fun onCreate()
Finally within the override fun onCreate()
we want to add the following at the very end.
Testing the Plugin
Here’s one last reminder to check out last month’s MAVSDK on Android tutorial for how setup the dependencies and SITL test.
To test the plugin, you’ll need to run a PX4 simulator. You can use a Docker container we used in the above tutorial to start a headless Gazebo PX4 simulator.
Once the simulator is running, compile and deploy your plugin to ATAK. You should see the drone’s position updating in real-time in the logcat output.
![](https://framerusercontent.com/images/J904w6ZDXOwNgr6qa9fCgmFXuWM.png)
Conclusion
In this tutorial, we’ve explored the process of creating ATAK plugins, from a not so simple “Hello World” example as well as MavSDK integration for drone control. We’ve covered the basics of setting up the development environment, creating layouts, and integrating with external systems like MavSDK.
ATAK plugins provide a powerful way to extend the functionality of the ATAK platform, enabling custom solutions for various operational scenarios. By leveraging the plugin architecture, developers can create tailored tools that enhance situational awareness and operational efficiency.
As you continue to develop ATAK plugins, consider exploring more advanced features such as custom map overlays, sensor integrations, or specialized communication modules using the HelloWorld example as a guide. The ATAK community and resources mentioned earlier can provide valuable support and inspiration for your future projects.
Remember to always test your plugins thoroughly and consider the security implications when working with sensitive data or in operational environments. Happy coding, and enjoy building powerful situational awareness tools with ATAK!
Additional Resources
https://play.google.com/store/apps/details?id=com.atakmap.app.civ
https://play.google.com/store/apps/details?id=com.atakmap.android.uastool.plugin
https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV