Book Image

Getting started with Udoo

Book Image

Getting started with Udoo

Overview of this book

Table of Contents (16 chapters)
Getting Started with UDOO
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Since the beginning of the 2000s, a global rekindled interest in hardware manufacturing occurred, due to many advances in engineering and microelectronics, which granted the proliferation of new kinds of inexpensive manufacturing tools. People of all ages, even children, started to convert their broken devices, old toys, and every unused piece of hardware, into new amazing objects. This unconventional approach to design and creating something new was characterized by a new way to express creativity, and this was the key factor that created the maker culture.

This was the maker revolution, a movement that changed our world radically. Open source projects provided all the required tools to unleash the creativity to build something, without the need for a strong knowledge in programming and engineering, nor a set of expensive components. Indeed, one of the most important successes achieved by the maker revolution was the capability to move prototypes manufacturing from small or big industries to our homes.

In February 2012, another open source project, called UDOO, started a prototyping board featuring Linux and Android operating systems, with the goal of combining the winning characteristics of Arduino and Raspberry Pi in one single board. After a year working on this project, in April 2013, the UDOO board joined the Kickstarter crowdfunding platform, and the feedback from the maker community was overwhelmingly positive—the project was funded in just 2 days.

Makers all over the world liked the project so much that they decided to contribute, not only through Kickstarter pledges, but even through useful ideas and advice during the board design phase. The result of the help provided by the maker community is a powerful prototyping board to build interactive and creative ideas we always wanted.

This book will teach you how to build your first hardware projects using the UDOO board as a fast prototyping tool. Starting with a simple application that involves the use of basic electronic components, you will work through different projects that let you build electronic circuits, with improved interactions and offered by the Android operating system.

What this book covers

Chapter 1, Turn On the Engines, walks you through the setup of the UDOO platform and the required development environment. It begins with an introduction of the board, showing its peculiarity and capabilities that distinguish it from the others; then it guides you through the installation of the Android operating system. The last part, explains how to configure the development environment, both for Arduino and Android, to launch the first Hello World Android application.

Chapter 2, Know your Tools, teaches how the Android application is capable of controlling connected devices. It begins with some onboard Arduino characteristics and then explains how to create the first Android application that is capable of communicating with the integrated Arduino device. It then shows how to create a fully functional circuit using a breadboard for fast prototyping.

Chapter 3, Testing your Physical Application, explains the main concept behind physical application testing. The first part shows how to build a circuit that is testable from a software application. It then shows how to implement a diagnostic mode to test whether the connected circuit is working correctly.

Chapter 4, Using Sensors to Listen to the Environment, begins by explaining how sensors work and how they can be used to make the prototype context aware. It then shows how to build a heartbeat monitor, coding an Arduino sketch to read the sensor's data, and an Android application to visualize the computed results.

Chapter 5, Managing Interactions with Physical Components, teaches how to manage user interactions. It starts by explaining some components that can be used to let the outside world interact with the system. It then shows how to build a web radio with a physical controller to manage the prototype volume and to change the current station. In the last part, an Android API is used to playback Internet radio streaming.

Chapter 6, Building a Chronotherm for Home Automation, explains how to use some UDOO capabilities for home automation. It shows the creation of a Chronotherm using a circuit to detect environment temperature, and an Android user interface to visualize sensor data and to change the desired temperatures for each time interval.

Chapter 7, Using Android APIs for Human Interaction, adds more functionality to the application from the previous chapter extending the settings management to store different presets using voice recognition and synthesis to manage users' interactions.

Chapter 8, Adding Network Capabilities, extends the Chronotherm application again with the capability to collect forecast data through a RESTful web service. In the last part, it shows how to use collected data to provide more functionalities to the Chronotherm.

Chapter 9, Monitoring your Devices with MQTT, teaches the main concepts of the Internet of Things and the MQTT protocol, used to exchange data between physical devices. It then shows how to set up a cloud-based MQTT broker, capable of receiving and dispatching the Chronotherm temperature updates. The last part shows how to write a standalone Android application to receive the sent data from the Chronotherm.

This a bonus chapter and is downloaded from the following link: https://www.packtpub.com/sites/default/files/downloads/1942OS_Chapter_9.pdf

What you need for this book

In order to run the code demonstrated in this book, you need to configure the development environment, both for Android and Arduino, and a dual or a quad UDOO board with the Android operating system installed, as described in the Downloading and installing Android and Setting up the development environment section in Chapter 1, Turn On the Engines.

Who this book is for

This book is for Android developers who want to apply their skills to build real-world devices capable of interacting with the surrounding environment and to communicate with Android applications. A basic knowledge of Android programming is required to start building real-world devices powered by Android. Prior knowledge of prototyping platforms or circuit building isn't required.

This book will teach you the basics of creating real-world devices through some electronic components that are regularly used during prototype building, and how to integrate them with the Android user interface.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The play() method sets the streaming URL of the current active station and starts the async prepare."

A block of code is set as follows:

public class HelloWorld extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_hello_world);
  }
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public class HelloWorld extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_hello_world);
  }
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "For the purpose of this HelloWorld application, select a Blank Activity and click Next."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.