Space Academy 3.0 is open — want to become a project contributor?Join in

Programming

Kotlin for FTC

Using Kotlin alongside Java in the FTC SDK, and when it is worth it.

1 min readUpdated Jul 18, 2026

The FTC SDK is a Gradle Android project, so Kotlin works with a plugin line and zero rewrites. Java and Kotlin files interoperate inside the same module.

Enabling KotlinLink to this section

TeamCode/build.gradle
apply plugin: 'org.jetbrains.kotlin.android'

What you gainLink to this section

  • Null safety — the class of crash that kills autonomous runs.
  • Data classes for poses, setpoints, and telemetry payloads.
  • Extension functions to clean up SDK APIs without wrappers.
  • Coroutines for sequencing, if your team understands them.
kotlin
@TeleOp(name = "Kotlin Drive")
class KotlinDrive : LinearOpMode() {
    override fun runOpMode() {
        val left = hardwareMap.dcMotor["leftDrive"]
        val right = hardwareMap.dcMotor["rightDrive"].apply {
            direction = DcMotorSimple.Direction.REVERSE
        }
        waitForStart()
        while (opModeIsActive()) {
            left.power = -gamepad1.left_stick_y + gamepad1.right_stick_x
            right.power = -gamepad1.left_stick_y - gamepad1.right_stick_x
        }
    }
}