PART I: WELCOME TO THE WONDERFUL WORLD OF ACCESSORIES CHAPTER 1: INTRODUCTION TO ANDROID OPEN ACCESSORY 3



Similar documents
Board also Supports MicroBridge

Leveraging the Android Accessory Protocol

Example Connection between USB Host and Android

VIT University Vellore , Tamil Nadu, India.

Health Monitoring Demo for ice40 Ultra Wearable Development Platform User Guide. UG103 Version 1.0, September 2015

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

Internet of things (IOT) applications covering industrial domain. Dev Bhattacharya

Home Automation & Security System Using Arduino Android ADK

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

TOSR0X-D. USB/Wireless Timer Relay Module. User Manual. Tinysine 2013 Version 1.0

Cypress Semiconductor: Arduino Friendly PSoC Shield

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

The Android Breathalyzer is not a professional Breathalyzer and should be used for Amusement Purposes Only. Drive Safely!

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

INTELLECT TM Software Package

HP Roar Plus Speaker. Other Features

Downloading Electro Scan Smartphone App From Google Play* * Previously known as The Android Market

RTOS based Home Automation System using Android

Point of View SmartTV-500 Center - Android 4.2. General notices for use...2 Disclaimer...2 Box Contents...2

Cloudvue Remote Desktop Client GUI User Guide

KonyOne Server Prerequisites _ MS SQL Server

FUTURELIGHT RDM PC DIRECTOR

A REST API for Arduino & the CC3000 WiFi Chip

International Journal of Engineering and Techniques - Volume 1 Issue 3, May - June 2015

How To Develop Android On Your Computer Or Tablet Or Phone

CS 589 Project Smart Home Hub, Phase I Due before 9am on October 21, 2015

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

DESIGN OF A TOUCHLESS USER INTERFACE. Author: Javier Onielfa Belenguer Director: Francisco José Abad Cerdá

LEGO NXT-based Robotic Arm

MediaQ M310. Quick Start HUAWEI TECHNOLOGIES CO., LTD.

New Technology Introduction: MIT App Inventor

JABRA STYLE. User Manual. jabra.com/style

2014 GSM SHIELD COMPATIBLE WITH ARDUINO GSM SHIELD USING SIMCOMM (SIM900A)

ZOTAC RAIDbox User s Manual

Programming the VEX Robot

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Android, Bluetooth and MIAC

STEREO WIRELESS BLUETOOTH HEADPHONES

SIP Protocol as a Communication Bus to Control Embedded Devices

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

Here to take you beyond Mobile Application development using Android Course details

Quick Start Guide: Iridium GO! Advanced Portal

Point of View SmartTV HDMI 210 dongle - Android 4.2. General notices for use... 2 Disclaimer... 2 Box Contents... 2

UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION

Computer Automation Techniques. Arthur Carroll

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Wireless Mobile speaker

NEW GENERATION PROGRAMMABLE AUTOMATION CONTROLLER

ATV310B User Manual. V1.1

PN532 NFC RFID Module User Guide

MAPMYFITNESS+ GUIDE FOR ANDROID. Spree Customer Service

KANGAROO MOBILE DESKTOP USER GUIDE

EZCast User s Manual

Designed for the needs of automation, telecommunications, remote supervision, and monitoring

JABRA SPORT Pulse wireless

Quickstart Guide Vodafone Mobile Wi-Fi R207

ANDROID BASED SECURITY AND HOME AUTOMATION SYSTEM

The Swivl Solution. Uses. Swivl User Guide. Swivl is more than just video capture, it is a 3-part solution.

Mobility with Eye-Fi Scanning Guide

3M Cloud Library Reading Apps

GSM Based Home Automation, Safety and Security System Using Android Mobile Phone

System Firmware Update Instructions for AVH-4000NEX

GPS Vehicle and personal location tracker. User manual

NAS 136 Controlling ASUSTOR Portal

Robotics and Engineering Design (SKN11) Syllabus

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Lab Experiment 1: The LPC 2148 Education Board

Android Architecture. Alexandra Harrison & Jake Saxton

Ways to Use USB in Embedded Systems

Arduino Training - Basics of Micro-controllers Programming Basics

ALON MP3 Dictaphone. User's manual. 1. Introduction 2. Audio Player 3. Voice Dictaphone 4. Phone calls recorder 5. Customer support.

Culturally Situated Sensors. Progress & Development on Culturally Situated Sensors and Sensor-Caching -Chris Shing

Mini PC Quick Start Guide

DSB-100 Portable Premium Bluetooth Speaker Owner s Manual

Android Setup Phase 2

Using the Android Platform to control Robots

Connecting to an AC Power Outlet (Optional) General Description. a Connect the AC adapter to the printer. b Connect the AC power cord to the AC

Bluetooth 4.0 Solutions for Apple ios Devices. Bluegiga Technologies

CHAPTER 1: INTRODUCTION TO ANDROID, MOBILE DEVICES, AND THE MARKETPLACE

FRC WPI Robotics Library Overview

Hi, let s get started. Sound Rise Wireless Speaker & Alarm Clock

Open Source building blocks for the Internet of Things. Benjamin Cabé JFokus 2013

INSPIRE 1 Release Notes Overview: What s New: Bug Fixes: 1. All-in-One Firmware version updated to: v

To perform Ethernet setup and communication verification, first perform RS232 setup and communication verification:

Running a Program on an AVD

Development of a GSM based Control System for Electrical Appliances

AirPatrol WiFi Full Manual V1.0

KNX IP only A New Class of KNX Devices. WEINZIERL ENGINEERING GmbH. Dr.-Ing. Th. Weinzierl D Tyrlaching

AXON Mobile for Android Devices User Manual

Installation Guide. Mobile Surveillance Distance makes no difference. eagleeyes_quick_v1.5

GFSU Certified Cyber Crime Investigator GFSU-CCCI. Training Partner. Important dates for all batches

Android Auto PoC. October Oct-15. Maxim Ovchinnikov Architect Harman

Apple iphone/ipod Touch - ieffect Mobile Guitar Effect Accessory & Application

Computer System Management: Hosting Servers, Miscellaneous

User's Guide. [Home Network] app. Model No.

Bluetooth Based Home Automation and Security System Using ARM9

SwannEye HD Plug & Play Wi-Fi Security Camera Quick Start Guide Welcome! Lets get started.

SENSE: USER GUIDE. Read Me to Get the Most Out of Your Device...

Transcription:

INTRODUCTION xxi PART I: WELCOME TO THE WONDERFUL WORLD OF ACCESSORIES CHAPTER 1: INTRODUCTION TO ANDROID OPEN ACCESSORY 3 I, Android 3 The Three Laws of Android 4 The Android Philosophy 6 Other Popular Systems 7 Preinstalled Applications 8 What Is Android Open Accessory? 9 Android USB in Short 9 Developing Android Accessories 10 What Is Arduino? 10 How Does AOA Work with Arduino? 11 What Can You Do with AOA? 12 What Can t You Do with AOA? 13 Why it Matters that Google Chose Arduino 14 Summary 15 CHAPTER 2: SETTING UP THE (ARDUINO) HARDWARE 17 Choosing Microcontroller Boards for Your Project 18 One Platform, Many Architectures 18 Shields 26 Choosing Sensors and Actuators for Your Project 29 Sensors 30 Actuators 34 Powering up Your Project 38 Ways to Power up Your Project 38 Arduino Feeding Your Phone 41 Summary 41 COPYRIGHTED MATERIAL

CHAPTER 3: UNDERSTANDING DATA COMMUNICATION 43 Data Communication Basics 43 Protocols 44 Terminology 45 Hardware Layer for the Communication Protocol 47 ADB 47 Accessory Mode 48 Host Mode 48 TCP/IP 50 Audio Port 52 Bluetooth Options 53 Introducing MQTT 54 Heads Up! 55 MQTT Messages 58 P2PMQTT: A Modified MQTT 63 Establishing a Connection 63 Subscribing to a Topic 63 Publishing a Message 64 Disconnecting 64 Summary 64 CHAPTER 4: SETTING UP DEVELOPMENT ENVIRONMENTS 67 Setting up Android Development 67 Android Development Environment 69 Hello, Android! 79 Setting up Arduino Development 80 Arduino Development Environment 80 Hello, Arduino! 82 Hello Open Accessory App 85 The Temperature Sensor 85 The Arduino Sketch 87 The Android Project 88 Ready to Go 88 Summary 89 CHAPTER 5: CREATING THE ACCESSORY LIBRARY 91 Getting Started with Android Libraries 92 Building the P2PMQTT Library 92 Preparing the Library Project 92 Sketching the API 93 xvi

Implementing MQTT 94 Decoding MQTT 108 Managing Open Accessory Connections 117 Creating the Connection Class 117 USB Connection 119 Bluetooth Connection 123 Creating the Connection 126 Summary 131 CHAPTER 6: USING YOUR ACCESSORY LIBRARY 133 Using Custom Android Libraries 133 The WroxAccessories Library 134 Building the Mini Projects 137 The LSMSD 137 The Parking Assistant 145 The Basic Robot 154 The Sampler 164 Summary 170 CHAPTER 7: DIGITAL ARDUINO 171 Digital Actuators 172 The Blinking LEDs 172 Controlling a Desk Lamp The Relay 178 Digital Project 1: Large SMS Display 182 Writing the Arduino Program 186 Digital Sensors 190 Buttons and Switches 190 Tilt Sensor 194 Digital Project 2: Small Sampler 197 Summary 202 CHAPTER 8: ANALOG ARDUINO 205 Analog Actuators 206 The Piezo Element 207 Motors 211 Analog Project 1: The Basic Robot 215 Analog Sensors 223 Potentiometers 224 Ultrasound Sensors 228 Analog Project 2: The Parking Assistant 233 Summary 239 xvii

PART II: PROJECTS CHAPTER 9: BIKE RIDE RECORDER 243 The Concept Behind Bike Computers 244 The Design Brief 245 Working with the Arduino Side 246 Creating the Hardware and Mechanics 247 Programming the Bike Computer 251 Building the Android App 259 Creating the Bike Ride Recorder Project 260 Creating the User Interface 261 Setting up the AoaService 266 Building the Main Menu Activity 271 Building the Recording Activity 271 Building the List Recordings View 282 Building the Playback View Activity 285 Making Further Improvements 290 Mechanics 290 More Sensors 290 Making a Better App 290 Summary 291 CHAPTER 10: KITCHEN LAMP 293 The Concept 293 The Design Brief 295 The Arduino Side 296 Hardware 298 Software 301 Building The Android App 307 Sketching the Application Layout 307 Create the Kitchen Lamp Project 308 Create the User Interface 308 Building the Kitchen Timer 313 Responding to Phone Calls 315 Listen for SMS Events 319 Connecting to the WroxAccessory 322 Further Improvements 325 Product-ready Embedded System 326 Making a Better App 326 Summary 327 xviii

CHAPTER 11: MR. WILEY 329 The Concept 330 The Design Brief 331 The Arduino Side 332 The Hardware 332 The Firmware (on the Robot Board) 335 Creating Software for the Mega ADK Board 340 Building the Android App 342 Sketching the Application Layout 343 Creating the Mr. Wiley Project 343 Building the Computer Vision Algorithm 348 Connecting to the WroxAccessory 358 Making Further Improvements 364 Electronics 364 Making a Better App 364 Summary 364 INDEX 365 xix