Skip to main content

Integrate Philips Hue in your Android application

Integrate Philips Hue in your Android application

You will find some components, based on Retrofit, that allow Android applications to communicate with Philips Hue Hub

You can find Philips Hue Documentation here.

Dependencies

The first thing to do is to add the required dependencies to the build.gradle file.

Data contracts

We define data contracts. This classes represent data exchanged with Hub API (Request / Response).

Light

Represents a light connected to the hub.

LightState

Represents the state of a light connected to the hub.

SetLightStateBody

Command body to update light state

LightService

Interface representing hub API

Helpers

HueBridgeApiHelper

Some functions to help with Retrofit (generates an implementation of LightService)

ColorConverter

Some color conversion operations (More informations here)

Usages