Warning
This is an alpha release of the Viam Java SDK. No guarantees are made to the stability of the API.
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
andviam-android-sdk-mlmodel-service
for machine learning modelsviam-android-module
for running modules on Android
See examples for more information:
- JDK 21+ (source is Java 11 compatible) (be sure to set
JAVA_HOME
) - Run
make setup buf
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.
- 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