My Guide to using Android Things - Ty Harness 2017


Android Things (TM) - a rapid software and hardware development OS for the IoT developer. The best way to learn any new system is to have a go at creating a thing. You have access to professional development tools backed with Google Services such as Tensor Flow, Assistant, Cloud IoT, Firebase. If you have Android experience then you can hit the ground running. So you'll need the latest Android SDK installed and in your PATH. You can download the Android Studio full monty if you prefer.

Getting Started (linux instructions)
Download the latest developer preview for the Raspberry Pi 3.

df -h
Take a note of what disks are mounted and insert your sd card into a card reader.

df -h
Hopefully, you can identify the sd card and any existing partitions.
My card is called mmcblk0 be carefull yours may be different. It has 3 partitions p1, p2, and p6.

sudo umount /dev/mmcblk0p1
sudo umount /dev/mmcblk0p2
sudo umount /dev/mmcblk0p6


Make sure you're 100% sure it's the sd card you're about to write to. If you're unsure don't do it.

sudo dd bs=4M if=iot_rpi3.img of=/dev/mmcblk0

takes ages, wait for the command prompt to return.

Eject card and insert into the raspberry pi.


Left: Android Things intial screen (iotlauncher) after first setup. Right: Demo app simplepio-example.

Did you have a LAN cable plugged in on boot with an internet connection. If so the date will have been set automatically. If the network is not connected to the internet you can't set up the wifi network until the date has been set. The Android Debug Bridge (ADB) comes with the Android sdk. With the LAN connected:

adb connect Android.local

and it should say Android.local:5555 has been connected.

adb shell dumpsys|grep top-activity

Proc #14: fore T/A/T trm: 0 633:com.android.iotlauncher/1000 (top-activity)

You'll see Iotlauncher app is the home activity.

If you have a monitor you'll see the above splash screen.

Use

adb logcat to debug your apps.

To get started have a go with some demo apps like sample-simplepio: sample-simplepio

Make up the breadboard circuits and follow the readme instructions. Once the app has been installed it will auto start on further reboots.

See the above you tube video and when you're finished experimenting with the app uninstall to get back to the iot launcher app.

adb uninstall com.example.androidthings.simplepio

My links

  • My Android Things(iot_rpi3 Dev Prev. 2) BMA220 Acceleration Logger
  • My Android Things(iot_rpi3 Dev Prev. 3) BMA220 Acceleration Logger
  • My Android Things(iot_rpi3 Dev Prev. 31) Voice Hat/Google Assistant
  • My Android Things(iot_rpi3 Dev Prev. 4) BMA220 Acceleration Logger
  • My Android Things(iot_rpi3 Dev Prev. 41) BMA220 Acceleration Driver and Sample App.


    Others links

  • developer.android.com/things/
  • github.com/androidthings
  • codelabs.developers.google.com/io2017
  • plus.google.com/communities/
  • www.novoda.com/blog/writing-your-first-android-things-driver
  • docs.gradle.org
  • android.com/studio/command-line/adb.html
  • adbshell.com/