Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Things

Android Things

An intro to Android Things - https://developer.android.com/things

Scott Alexander-Bown

March 20, 2017
Tweet

More Decks by Scott Alexander-Bown

Other Decks in Technology

Transcript

  1. Cameras Gateways HVAC Control Smart Meters Point of Sale Inventory

    Control Interactive Ads Vending Machines Security Systems Smart Doorbells Routers Energy Monitors Asset Tracking Fleet Management Driver Assist Predictive Service Ideal for powerful, intelligent devices on the edge that need to be secure. @scottyab
  2. dependencies { provided 'com.google.android.things:androidthings:...' } <application ...> <uses-library android:name="com.google.android.things"/> <activity

    ...> ... <!-- Launch activity automatically on boot --> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.IOT_LAUNCHER"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> </application> Home Activity @scottyab
  3. private GpioCallback callback = new GpioCallback() { @Override public boolean

    onGpioEdge(Gpio gpio) { int keyAction = gpio.getValue() ? KeyEvent.ACTION_DOWN : KeyEvent.ACTION_UP; inputDriver.emit(new KeyEvent[]{ new KeyEvent(keyAction, KeyEvent.KEYCODE_SPACE)}); return true; } }; Button User Driver (inside your Activity class) InputDriver inputDriver = InputDriver.builder(InputDevice.SOURCE_CLASS_BUTTON) .setName(DRIVER_NAME) .setVersion(DRIVER_VERSION) .setKeys(new int[]{KeyEvent.KEYCODE_SPACE}) .build(); UserDriverManager.getManager().registerInputDriver(inputDriver);
  4. • Download the latest preview image • writing the image

    to SD card • Insert the flashed microSD card into your board. • Connect power, ethernet and HDMI • Connect via adb (IP shown on screen) $ adb connect <ip-address> connected to <ip-address>:5555 Setting up your Raspberry Pi 3 @scottyab
  5. • Smart doorbell with camera • Weather station • Distributed

    Piano (by @riggaroo) • Electricity monitor (by @riggaroo) Example projects @scottyab
  6. • Dev preview • No one is using live i.e

    distribution untested • Weave not available yet • Significant hardware requirements CONS @scottyab
  7. Google's IoT Developers Community https://g.co/iotdev Google's IoT Solutions https://iot.google.com Android

    Things SDK https://developer.android.com/things Scott Alexander-Bown Freelance Android Developer @scottyab