Displays are optional

The most significant characteristic of Android Things is that it has been designed to work without a graphical user interface. This is a very logical decision if you consider that most IoT devices do not have a screen. It is important because it dictates that all the APIs that have a strong requirement for a screen need to be redesigned or disabled/removed.

Quite often, this design decision is misunderstood as that Android Things does not support graphical user interfaces. That is not correct. You can use the same classes as you would do when building a UI on Android, the same way to create layouts and assign them to an activity. Those layouts will work fine and you can rely on them if you are building a device that has that sort of interface, but it is not a requirement for an Android Things project.

If you want to build a UI for Android Things, you can do it in the same way you would do it on Android.

One small difference is that Android Things does not have a status bar or navigation buttons and, therefore, the application window takes all the real state of the display. This also implies that there is no way of displaying notifications on Android Things, so the Notification API is not present

Although you cannot display notifications on Android Things, you can use Firebase Cloud Messaging to send messages to your app to trigger events.

Finally, even though you may not have a UI, the key component we will use to build our applications is the Activity, but, in many cases, it will not have a visual component.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.79.60