Build Your Own Google Home Using Raspberry Pi and Android Things

Build Your Own Google Home Using Raspberry Pi and Android Things

Build your own Google Home using Raspberry Pi and Android Things A powerful electronics platform running the familiar Android stack with full Java API support Arnav Gupta Co-Founder & Android Mentor @ Coding Blocks THE ANDROID FOR IOT ARCHITECTURE Familiar Android Stack Android Things High Level Overview WHAT BRILLO HAD PROMISED US ? What part is used from Android ? What part is used from Android ? HOW ANDROID THINGS FINALLY PANNED OUT The full Android Stack What is present on Android Things PREPARING FOR THE ANDROID THINGS ADVENTURE Requirement 1: The Board (any one) • Raspberry Pi 3 • NXP Pico MX6 • NXP Pico MX7 (Recommend this) • Intel Edison • … or crack open an old Android phone you’re not using :P Requirement 2: Lights and Buttons • 1xLED + 1xButton + Breadboard + Resistors • Or, get a Rainbow Hat Requirement 3: Audio (In & Out) • Speaker + Mic (if needed, use a 2 to 1 plug) • Protip: Search for “office conference room speakerphones” GET YOUR OPERATING SYSTEM Go to “Android Things Console” LOL ! Google SEO Fail :P Create a new product there Select your board Create new factory image Flash it • For NXP devices, fastboot flash (like you flash Nexus/Motorola devices) • For Raspberry, flash SD Card with Etcher WRITING ANDROID THINGS APPS Tell Gradle that this is Android Things Usually you’d want your app to be default and only app What not to use ? Supported Google APIs Unsupported Google APIs Wait a sec . Runtime permissions ? • Normal Permissions = At install time • Dangerous Permissions = After device reboot • No runtime dialog boxes (duh, no display) Cloud IOT Core = The Firebase for Android Things LET’S TAKE AN ELECTRONICS CLASS Basic Electronics supported • GPIO – Digital Inputs and Outputs • PWM – (Fake) Analog Inputs and Outputs • Serial Communication – I2C (Synchronous, Low Speed, 2-wire) – SPI (Synchronous, HighSpeed, multi-wire) – UART (Asynchronous, Only 1 peripheral) GPIO: Active High vs Active Low PWM: Analog using Digital BUTTONS AND LIGHTS The Button driver Using the Button Using the Button Lighting up LED via GPIO THE GOOGLE ASSISTANT API https://developers.google.com/assistant/sdk/reference/rpc/ DEMO Links and Resources • https://github.com/androidthings • https://github.com/championswimmer/googl e_assistant_iot (This project I demoed) • My Slides: https://speakerdeck.com/championswimmer Weighing Pros and Cons of Android Things • We get > 50% of powerful • Uses a lot of resources (vs Android Stack Linux Kernel + C/Cpp bin) • Code sharing with • Dodgy async and multi- Android applications threading (electronics are • Easier to attach ad-hoc UI always sync) • Future: Easy delivery via • Can make similar projects Play Store using JS libs in < 5% code • Google Backing (duh!) • High code complexity trap @championswimmer [email protected] TM 2018 Conference and Deep Dive Sessions April 24-28, IISc Bangalore Register early and get the best discounts! @greatindiandev bit.ly/gidslinkedin www.developersummit.com.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    49 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us