Firebase Realtime Database

The second approach we are going to explore is Firebase Realtime Database. This is a very common example because it showcases how third-party tools can simplify and speed up your development.

For this part, we will have a shared realtime database used by both the things and the mobile apps. That database will have one row with the current values of the temperature and the LED status.

The things app will write the temperature entry to the database and listen for modifications on the LED one.

The mobile app will do the reverse operation: write the LED value when the switch changes and listen for changes on the temperature value to display them on the UI.

To begin with, we need to create a project on the Firebase console ...

Get Android Things Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.