To add the Home APIs to an Android app, you'll need to meet a few prerequisites.
Prerequisites
For development, you'll need a computer with the following tools installed on it:
Android Studio, version 2024.2.1 ("Ladybug") or later. Note that versions earlier than this may not work properly with the Home APIs SDK.
The Android debugger (
adb
).Install
adb
.This can be done with the SDK Manager.
And to test the Home APIs, you'll need:
- An Android device running Android 10 or later set up with a Google Account you intend to use for development. Make sure an up-to-date version of the Android Studio is installed and signed into with this development account.
- A Wi-Fi network.
- A Google hub that supports the Home APIs.
At least one supported device in the home. If this device (or any other you want to test) uses Thread, the hub must also be a Thread border router. The following device types and traits are supported by the Android sample app:
- Color Temperature Light (on and off, brightness)
- Contact Sensor (boolean state)
- Dimmable Light (on and off, brightness)
- Extended Color Light (on and off, brightness)
- Generic Switch
- Occupancy Sensor (occupancy sensing)
- On/Off Light (on and off, brightness)
- On/Off Light Switch
- On/Off Plug-in Unit (on and off)
- On/Off Sensor
Supported hubs
Only certain Google Nest hubs feature support for the Home APIs.
Set up the SDK
The Home APIs in this open beta are not yet part of the standard libraries provided by Google for development. In order to develop applications with the Home APIs, you need to download and host the libraries locally.
To download the Home APIs Android SDK, you must first be signed into Google Home Developers.