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

Android Things for IoT

Ngesa Marvin
November 18, 2017

Android Things for IoT

This presentation was given at GDG DevFest Rift Valley 2017, Moi University on the 18th November 2017. It covers Open Source Hardware and Android Things. It also covers the steps and tools you need to go from your developer kit prototype to fabricating custom boards for your own product.

Ngesa Marvin

November 18, 2017
Tweet

More Decks by Ngesa Marvin

Other Decks in Technology

Transcript

  1. GDG

  2. • Software & Hardware become Open source • Patents and

    Copyrights are not important in Shenzhen. • But, they make something new, Shanzai makes Innovation [ Deploy or Die ]
  3. David Li SZOIL is a space and platform for worldwide

    makers to communicate and cooperate Xinchejian is the first hackerspace in China. David Li
  4. “Bunnie” Andrew Huang • Famous Hacker & Maker • PhD

    in Electrical Engineering from MIT • Famous Projects: • Novena Open Source Laptop • Reverse Engineering blog: https://www.bunniestudios.com • Wired Future Cities Documentary on Shenzhen
  5. • Founder & CEO Seeed Studio • Electronic Engineer •

    Forbes 30 Under 30 • Worked at Intel as a Designer • Organizer Shenzhen Maker Faire Eric Pan Eric Pan
  6. 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.
  7. AndroidThings Console • Manage your Android Things IoT Product •

    Download and install the latest Android things system image • Build factory images that contain OEM applications along with the system image • Push over-the-air (OTA ) updates
  8. Determining the Need The application of the PCB, such as

    medical or automotive, will often determine the materials in the PCB
  9. • Circuit • Tweezers • Soldering Gun • Components •

    Soldering Station (Iron) What you need:
  10. 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
  11. // Open a peripheral connection PeripheralManagerService service = new PeripheralManagerService();

    Gpio button = service.openGpio(GPIO_PIN_NAME); // Configure the peripheral button.setDirection(Gpio.DIRECTION_IN); button.setEdgeTriggerType(Gpio.EDGE_FALLING); // Attach callback for input events button.registerGpioCallback(new GpioCallback() { @Override public boolean onGpioEdge(Gpio gpio) { Log.i(TAG, "GPIO changed"); // Return true to continue listening to events return true; } }); Simple Peripheral I/O
  12. 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 InputDriver driver = new InputDriver.Builder(InputDevice.SOURCE_CLASS_BUTTON) .setName(DRIVER_NAME) .setVersion(DRIVER_VERSION) .setKeys(new int[]{KeyEvent.KEYCODE_SPACE}) .build(); UserDriverManager.getManager().registerInputDriver(driver);
  13. GPIO PWM I2C I2S SPI Audio Input Sensors Peripheral Driver

    Library Peripheral I/O User Drivers GPS UART
  14. dependencies { compile 'com.google.android.things.contrib:driver-button:...' } ButtonInputDriver inputDriver = new ButtonInputDriver(

    GPIO_PIN_NAME, Button.LogicState.PRESSED_WHEN_LOW , KeyEvent.KEYCODE_SPACE ); inputDriver.register(); Button Library Driver
  15. Updates DP4 DP5 (July) Later this year Based on O

    PIO Pin Muxin Developer Console with OTA support And more… Audio User Driver Native I2S iMX7D Assistant SDK Sample GMSCore for IoT Smart setup NFC support Additional SoMs And more…
  16. Google's IoT Developers Community https://g.co/iotdev Android Things SDK https://developer.android.com/things Hackster.io

    Community https://hackster.io/google What’s Next? Ngesa N. Marvin IoT Champion for GDGs, SSA +Ngesa Marvin @Ngesa254