tree: 4698d3591aeb2f8f9887eeae784daf813edf13b2 [path history] [tgz]
  1. include/
  2. java/
  3. third_party/
  4. .gitignore
  5. .gn
  6. args.gni
  7. BUILD.gn
  8. Manifest.txt
  9. README.md
examples/java-matter-controller/README.md

Matter Controller Java App Example

This is a Matter Controller Java app that can be used to commission and control Matter accessory devices. It offers the following features: - Commission a Matter device - Send echo requests to the Matter echo server - Send on/off cluster requests to a Matter device

Requirements for building

You need Android SDK 21 & NDK 21.4.7075529 downloaded to your machine. Set the $ANDROID_HOME environment variable to where the SDK is downloaded and the $ANDROID_NDK_HOME environment variable to point to where the NDK package is downloaded.

  1. Install Android Studio
  2. Install NDK:
    1. Tools -> SDK Manager -> SDK Tools Tab
    2. Click [x] Show Package Details
    3. Select NDK (Side by Side) -> 21.4.7075529
    4. Apply
  3. Install Command Line Tools:
    1. Tools -> SDK Manager -> SDK Tools Tab -> Android SDK Command Line Tools (latest)
    2. Apply
  4. Install SDK 21:
    1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 5.0 (Lollipop) SDK Level 21
    2. Apply
  5. Install Emulator:
    1. Tools -> Device Manager -> Create device -> Pixel 5 -> Android S API 31 -> Download

Linux

export ANDROID_HOME=~/Android/Sdk
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/21.4.7075529

MacOS

export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/21.4.7075529

Preparing for build

Complete the following steps to prepare the Matter build:

  1. Check out the Matter repository.

  2. Run bootstrap (only required first time)

    source scripts/bootstrap.sh
    

Building & Running the app

This is the simplest option. In the command line, run the following command from the top Matter directory:

./scripts/build/build_examples.py --target android-x86-java-matter-controller build

The Java executable file java-matter-controller will be generated at out/android-x86-java-matter-controller/bin/