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

Android Things - Things matter

Android Things - Things matter

Android Things is an Android-based embedded operating system platform by Google. Android Things lets you build professional, mass-market products on a trusted platform, without previous knowledge of embedded system design. This talk covers how to start with Android Things, Flash OS on development board and Connect devices with NXP Pico i.MX7D platform and control that using Android mobile & Google Assistant application.

You will be learning below things,
- Getting started with Android Things
- How to build and flash OS on development board
- Control devices through Google Assistant (NXP Pico i.MX7D, Breadboard, LED, Google Home, Dialogflow application, Firebase Real time database & Cloud Functions)

Jaldeep Asodariya

October 28, 2018
Tweet

More Decks by Jaldeep Asodariya

Other Decks in Technology

Transcript

  1. Triggering Ok Google, talk to brainy things. Gandhinagar Hey Google,

    let me talk to brainy things. Ask brainy things about power on my living room main light.
  2. Gandhinagar How does it work? Actions on Google Dialogflow Firebase

    Realtime Database Firebase Cloud Functions Android Things Android
  3. Android Things is an extension of the Android platform for

    IoT and embedded devices Gandhinagar
  4. things: build.gradle dependencies { compileOnly 'com.google.android.things:androidthings:1.0' } AndroidManifest.xml <application ...>

    <uses-library android:name="com.google.android.things" /> <activity ...> ... </activity> </application>
  5. things: build.gradle dependencies { compileOnly 'com.google.android.things:androidthings:1.0' } AndroidManifest.xml <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>
  6. MainActivity.java //Init PeripheralManager PeripheralManager mPeripheralManager = PeripheralManager.getInstance(); Gpio mGpio1IO10 =

    mPeripheralManager.openGpio("GPIO1_IO10"); // Configure the peripheral mGpio1IO10.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW); // Set it at some point later mGpio1IO10.setValue(false);
  7. MainActivity.java //Init PeripheralManager PeripheralManager mPeripheralManager = PeripheralManager.getInstance(); Gpio mGpio1IO10 =

    mPeripheralManager.openGpio("GPIO1_IO10"); // Configure the peripheral mGpio1IO10.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW); // Set it at some point later mGpio1IO10.setValue(false); // Do not forget to close gpio mGpio1IO10.close();
  8. MainActivity.java mRoomRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot)

    { for(DataSnapshot roomSnapshot : dataSnapshot.getChildren()) { MdlRooms objMdlRoom = roomSnapshot.getValue(MdlRooms.class); @Override public void onCancelled(@NonNull DatabaseError databaseError) { … } });
  9. MainActivity.java mRoomRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot)

    { for(DataSnapshot roomSnapshot : dataSnapshot.getChildren()) { MdlRooms objMdlRoom = roomSnapshot.getValue(MdlRooms.class); if(objMdlRoom.getDevices() != null) { Map<String, MdlDevices> objMap = objMdlRoom.getDevices(); ... @Override public void onCancelled(@NonNull DatabaseError databaseError) { … } });
  10. MainActivity.java mRoomRef.addValueEventListener(new ValueEventListener() { ... Map<String, MdlDevices> objMap = objMdlRoom.getDevices();

    for (MdlDevices objMdlDevices : objMap.values()) { } @Override public void onCancelled(@NonNull DatabaseError databaseError) { … } });
  11. MainActivity.java mRoomRef.addValueEventListener(new ValueEventListener() { ... Map<String, MdlDevices> objMap = objMdlRoom.getDevices();

    for (MdlDevices objMdlDevices : objMap.values()) { switch (objMdlDevices.getGpio()) { case PIN_NXPMX7D_GPIO1_IO10: ... mGpio1IO10.setValue(objMdlDevices.getTraits().isOn()); break; } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { … } });
  12. Intent Matching - Match and categorize user utterances to an

    intent. Gandhinagar Entity Extraction - Identify key words and phrases spoken by the user. “ @
  13. Gandhinagar Jaldeep Asodariya, GDG Ahmedabad @jaldeepasodariy Thank you! Dank je!

    ध यवाद! ধন বাদ! ہﯾرﮑﺷ ﺎﮐ پآ! ﻲﻧﺎﺑرﮭﻣ ﻲﺟ نﺎھوﺗ! ကျေးဇူးတင်ပါတယ်! ന ി! ありがとうございました! Ευχαριστώ! Gràcies! ਤੁਹਾਡਾ ਧੰਨਵਾਦ! ಧನ ಾದ! À ringrazià ti! 谢谢! ந றி! ధన ా ల ! ¡Gracias! Faleminderit! આભાર! ขอขอบคุณ!