NOTE: The 2016 Version of the navX-Micro Android Library for FTC has currently been tested with the FTC “ftc_app” library beta version 2.0 – and is expected to work without change once the FTC “ftc_app” library is released on or about September 15, 2016.
The navx_ftc Android software library supports access to navX-Model devices via the I2C communication interface. Several example programs are provided, demonstrating how to use a navX-Model device in a FTC-based robot control application.
To use the library, you can download the latest build of the libraries, or you can checkout the source code with Git. To learn more about the library, online help is available.
Getting Started
Before getting started, ensure you have installed Android Studio and the latest FTC Robot Controller Application (“ftc_app”) package.
Several sample Java Robot Applications are provided. After running the setup program included in the latest build, the libraries and samples will be installed to the following location:
<HomeDirectory>\navx-micro\android
For example, if your user name is Robot, the directory name will be C:\Users\Robot\navx-micro\android.
Within this directory, the “examples” sub-directory contains several example programs. Select the example you wish to start with and copy it into your project as follows:
- Copy one or more of the example navX-Model “op modes” files from the <HomeDirectory>\navx-micro\android\examples directory into your project’s “TeamCode” top-level directory. (i.e., org.firstinspires.ftc.teamcode).
Next, several configuration changes must be made in order that the Android Studio ftc_app-based project can locate the navx_ftc library:
- Modify the op mode example file to change the following line near the top of the file to match the I2C port on the Core Device Interface Module to which you have connected the navX-Model device:
private final int NAVX_DIM_I2C_PORT = 0; /* See the installation page for details on port numbering. */
- Modify your robot application’s (the “TeamCode” project) build.release.gradle file repository list to add a reference the directory where the navx_ftc library is installed:
repositories { flatDir { dirs 'libs', 'C:\\Users\\Robot\\navx-micro\\android\\libs' } } - Again in the same build.release.gradle file, add the navx_ftc library to the list of libraries the ftc_app will link to – by adding this line near the bottom of the gradle build file, in the dependencies section:
dependencies { ... compile (name:'navx_ftc-release', ext:'aar') }
Linux/MacOS distribution
For developers on Linux and Mac OS platforms, the latest non-Windows build is also available. Please note that this build does not contain any of the navX-Micro tools, but does contain the RoboRIO and Android libraries.
This distribution is packaged as a .zip file; unzip the file and follow the instructions in the readme.txt file in the top-level directory.
Once you have installed the Android libraries onto your computer, use the instructions in the Getting Started section above to use the library. However, you will need to replace “C:\Users\Robot\navx-micro” in several places shown above with the corresponding path on Linux/MacOS where you installed the Android libraries.

