Android Things Quick Start Guide - Programming Ebook


Download Programming Ebook

Friday, April 17, 2020

Android Things Quick Start Guide

Android Things Quick Start Guide
Android Things Quick Start Guide

Book Details 
             TitleAndroid Things Quick Start Guide
         Author: Raul Portales
    Language: English
        SubjectKotlin / Androidd
No. of pages: 185
         Format: PDF, EPUB, Source code

Build your own smart devices using the Android Things platform 


This book will give you a quick start on Android Things, the platform for IoT made by Google and based on Android. We will go through the basics of IoT and smart devices, interact with a few components that are commonly used on IoT devices, and learn the protocols that work underneath, using examples and a hands-on approach.

We take our hands-on learning approach by going straight into playing with hardware using the Rainbow HAT, so we don't need to do any wiring. We then dig through layer after layer to understand what is being used underneath, but only after we have seen them working. If you are curious about more in-depth learning (such as writing your own drivers), you can always go into the next layer, because almost all the code referenced in this book is open source.

Android Apprentice Update for Android studio 3.0 and Kotlin 1.3 Ray Wenderlich Books

Who this book is for

Since Android Things is a simplified version of Android, you only need a very basic knowledge of how Android works. If you have never done any Android development you will be able to follow along because our examples are kept simple by design.
If you have some experience with other similar platforms, that will be handy, but not necessary. This guide is designed for people that have little to no experience with electronics and microcontrollers but want to get started with them.

Basic knowledge of electronics is desired. That implies that you are familiar with the concepts of voltage and current, as well as resistors, diodes, and capacitors. You also need to know how to read a diagram (there will be a few in this book). All that is very basic knowledge. If you are not familiar with these concepts, you still can follow along, but ultimately you need to understand them to design your own schematics.
Throughout the book we will be using Kotlin as the programming language because it is more modern than Java and allows us to write more concise and easier-to-follow code. Kotlin is meant to be the future of Android development, and it makes a lot of sense to use it on the newest Android platform.

What this book covers

Chapter 1, Introducing Android Things, goes over the big picture of Android Things, the vision behind the platform, and how it compares to other in principle similar ones, such as Arduino. Then we will explore the Dev Kit, how to install Android Things on them and how connect to the boards to deploy our code to them. Finally, we will create of a project for Android Things using Android Studio, see how it is structured, and what are the differences from a default Android project.

Chapter 2, The Rainbow HAT, explains how to use the Rainbow HAT to get started with interactions with hardware. This HAT (Hardware On Top) is a selection of components that you can plug into a Dev Kit in order to start working with them without the need for any wiring. We will learn how to use LED, buttons, read temperature and pressure from a sensor and display it on an LCD alphanumeric display, play around with an RGB LED strip, and even make a simple piano, all using high-level abstraction drivers.
In the next four chapters we will take a look at what is under the hood and we will start exploring the different protocols in depth.

Chapter 3, GPIO Digital Input/Output, goes over General Purpose Input Output (GPIO), which is what we used for the buttons and LEDs. We will learn how to access them directly and then look at other sensors that use GPIO, such as proximity and smoke detectors, as well as other components that also interact via GPIO, such as relays, DC motor controllers, stepper motors, ultrasound proximity sensors, and a numeric LCD display.

Chapter 4, PWM Buzzers, Servos, and Analog Output, focuses on Pulse Width Modulation (PWM) and its basic usages, of which we have already have seen the piezo buzzer. The most popular use of PWM is servo motors, so we will see how they work. Finally, we'll learn how to use PWM as an analog output.

Chapter 5, I2C Communicating with Other Circuits, covers the Inter-Integrated

(I2C ) protocol. We have already used it for the temperature/pressure sensor and the LCD alphanumeric display. I2C is the most widely used protocol for simple communication between circuits, and we will explore a few of them. One of the key ones is analog to digital converters (ADC), and we will see how we can use them to read from analog sensors. Other components include magnetometers, accelerometers and IMUs in general, as well as GPIO and PWM expansion boards.

Chapter 6, SPI Faster Bidirectional Communication, is based on the last protocol we'll look into: Serial Parallel Interface (SPI). We have already used this protocol for the RGB LED strip, and in this chapter we will look at some other drivers, such as OLED displays and LED matrix.

Chapter 7, The Real Power of Android Things, explores some areas where Android Things really shines by using some libraries and services that enable us to make the most of our developer kit. Among the topics we will cover are the use of Android UI, making companion apps using a REST API, Firebase, and Nearby, and we will briefly explore other libraries, such as Tensorflow for machine learning.

Appendix, Pinouts diagrams and libraries, we go over the Pinout diagrams of Rasberry PI and NXP iMX7D. We will then go into details about the state of unsupported Android features and intents on Android Things 1.0, as well as the state of available and unavailable Google APIs on Android Things.

To get the most out of this book

To get the most out of this book you'll need an Android Things Dev Kit and a Rainbow HAT because it will allow you to run all the examples in Chapter 2, The Rainbow HAT.
There are a lot of other hardware components that you don't require, but they are interesting to have just to see them working. I recommend that you acquire the ones you are interested in. We go into more detail about developer kits and how to pick the right one, as well as a summary of the other hardware, as part of Chapter 1, Introducing Android Things

No comments:

Post a Comment