Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting started with Udoo

You're reading from   Getting started with Udoo Become an efficient maker by designing and building amazing prototypes with the UDOO platform and Android

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784391942
Length 206 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Emanuele Palazzetti Emanuele Palazzetti
Author Profile Icon Emanuele Palazzetti
Emanuele Palazzetti
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Improving the boiler with an antifreeze check


Now that the forecast fetching is up and running, we can proceed with implementing the antifreeze feature. To achieve the interaction and the logic previously discussed, we should:

  1. Enhance the Preset class storing the user's antifreeze setpoint. In this class, we should provide two utilities to disable the antifreeze check and to find out whether the feature is enabled or not.

  2. Handle the antifreeze feature in the Overview activity, updating the user interface when a setpoint is selected.

  3. Update the boiler logic in the SensorThread class so it takes into account the antifreeze check when it's enabled.

We begin our work by changing the Preset class with the following steps:

  1. At the top of the class, add the highlighted declarations:

    private static final String CURRENT_LOCATION = "__LOCATION__";
    private static final String CURRENT_ANTIFREEZE = "__ANTIFREEZE__";
    private static final float ANTIFREEZE_DISABLED = -Float.MAX_VALUE
    

    We use the ANTIFREEZE_DISABLED...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image