About the Authors
Stephen Chin is the Lead Java Community Manager at Oracle and JavaOne Content Co-Chair. He has keynoted numerous Java conferences around the world, including JavaOne, where he is a four-time Rock Star Award recipient. Stephen is an avid motorcyclist who has done several pan-European evangelism tours, interviewing hackers in their natural habitat and posting the videos on http://nighthacking.com/. When he is not traveling, Stephen enjoys teaching kids how to do embedded and robot programming together with his 12-year-old daughter.
James Weaver is a Java developer, author, and speaker with a passion for helping Java to be increasingly leveraged in rich-client applications and the Internet of Things. James has authored and co-authored several books, including Inside Java, the Beginning J2EE series, and the Pro JavaFX series. He also speaks internationally at software technology conferences about Java, JavaFX, IoT, and cloud computing. James tweets as @JavaFXpert, and blogs at both http://JavaFXpert.com and http://CulturedEar.com.
About the Technical Editor
Mark Heckler is a Pivotal Developer Advocate, conference speaker, and published author focusing upon software development for the Internet of Things and the Cloud. He has worked with key players in the manufacturing, retail, medical, scientific, telecom, and financial industries and various public sector organizations to develop and deliver critical capabilities on time and on budget. Mark is an open source contributor, author/curator of a developer-focused blog (HYPERLINK http://www.thehecklers.org/ http://www.thehecklers.org), and possessor of an occasionally interesting Twitter account (@MkHeck). Mark lives with his very understanding wife in St. Louis, MO USA.
Copyright 2016 by McGraw-Hill Education (Publisher). All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a data base or retrieval system, without the prior written permission of the publisher.
ISBN: 978-0-07-184202-0
MHID: 0-07-184202-0
The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-184201-3, MHID: 0-07-184201-2.
eBook conversion by codeMantra
Version 1.0
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.
Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. All other trademarks are the property of their respective owners, and McGraw-Hill Education makes no claim of ownership by the mention of products that contain these marks.
Screen displays of copyrighted Oracle software programs have been reproduced herein with the permission of Oracle Corporation and/or its affiliates.
Information has been obtained by Publisher from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, Publisher, or others, Publisher does not guarantee to the accuracy, adequacy, or completeness of any information included in this work and is not responsible for any errors or omissions or the results obtained from the use of such information.
Oracle Corporation does not make any representations or warranties as to the accuracy, adequacy, or completeness of any information contained in this Work, and is not responsible for any errors or omissions.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Educations prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
Contents at a Glance
Contents
Acknowledgments
I want to thank my wife, Justine, and two daughters, Cassandra and Priscilla, for their support, encouragement, and sacrifice to make this book happen.
Stephen Chin
Id like to thank Stephen Chin for envisioning this book and inviting me to help write it, Mark Heckler for agreeing to review the book for technical accuracy, and Brandi Shailer for shepherding the process. Of course, Id like to thank my wife Julie, daughters Lori and Kelli, and grandchildren Kaleb and Jillian for their unbounded love and support. Psalm 28:7.
James L. Weaver
Introduction
T he Raspberry Pi has started a revolution in embedded development, reducing the barriers of entry for computer programmers to build devices that interact with the physical world. Java SE and Java ME Embedded use the Raspberry Pi as their reference platform, making it the platform of choice for Java developers who are getting started in embedded development. Java also comes preinstalled on the official Raspbian image, making it the highest-performing high-level language available for the Raspberry Pi. We, the authors, took advantage of the sweet spot of programming the Raspberry Pi with Java to help you get up to speed on developing for the Internet of Things, and joining the IoT revolution.