1301
How Libraries Work

Go back to 0000 Index

You should probably know what a library is unless you haven't taken a single entry computer science/programming course, but if you don't, a library is just code that another person wrote that you can use so you don't have to write it yourself.

Library Installation

Libraries are generally installed using Gradle. If you don't know what Gradle is, it is a build tool for Java. It allows you to download libraries and to set up custom rules for how to build your project (e.g. building with dependency A when running one script, but dependency B with another).

Most libraries you can use will have their own installation guide, but in general to install a library you need to paste their implementation into your build.gradle file.

Using the NextFTC installation guide, we can copy their implementation into our build.gradle file. This means we have to add the following line (as of recording) into the implementations:

implementation 'dev.nextftc:ftc:1.0.0'

Library Usage

Once you have a library installed, you can use it by importing any of its classes and using them as if they were in your own code. If you are using Android Studio or another Java IDE, you should be able to automatically import the classes you need as you need them.