Skip to content

viamrobotics/viam-java-sdk

Repository files navigation

Viam Java SDK

Warning

This is an alpha release of the Viam Java SDK. No guarantees are made to the stability of the API.

Installation

This SDK provides Java and Android libraries. To install, add appropriate dependency to your gradle file:

// build.gradle

dependencies {
    // For Java
    implementation 'com.viam:viam-java-sdk'

    // For Android
    implementation 'com.viam:viam-android-sdk'
}

The SDK also provides additional packages to enable various functionality:

  • viam-java-sdk-mlmodel-service and viam-android-sdk-mlmodel-service for machine learning models
  • viam-android-module for running modules on Android

See examples for more information:

Dependencies

  • JDK 21+ (source is Java 11 compatible) (be sure to set JAVA_HOME)
  • Run make setup buf

Examples

Examples can be found in the various example directories:

Two pure Java examples are ready to run out of the box to help get you started. You can run them with the commands make run_server to start a gRPC server, and then make run_client to run the example client against that server.

Known Issues

  • Android 10 (the min supported at API 29) testing appears to show that webrtc video decoding is failing. This needs to be looked into but could be a simple fix of passing in different decoder factory settings. Android 14 works great.
  • Custom modular APIs not yet supported
  • These libraries use protobuf-lite, not protobuf-java. See further discussion at protocolbuffers/protobuf#8104