Open In App

Getting Started with Android Things

Basically, Android Things refers to the summation of Android and the Internet of Things. IoT is very autonomous it means the Internet of Things, whatever the IoT device is, it can sense through sensors and do its respective task without very much human interaction and Android Things revolves around IoT devices. For IoT devices, sensors play the most important role in sending and analyzing data into the cloud. It comes with the idea that any device which we use in our daily life can be connected to the Internet. Now, to build those products there has to be an element of computing power inside those devices and there we need a computer, a chip, and an Operating System which have internet connectivity so there come Android Things. Google has made it very easy for software to connect with the hardware by releasing Android Things OS. Anyone who has knowledge of android and java can use it to build IoT devices to connect the hardware to the internet and get the task done.

Getting Started with Android Things

Hardware



Get the board and flash Android Things into the board, you can choose from the following:

  1. Raspberry Pi 3: It uses a quad-core cortex a53 chip at 64 bit.
  2. Intel Edison: It uses an Intel x86 chip.
  3. NXP Pico: It uses a cortex a7 based chip.
  4. Peripherals: Includes a breadboard, resistor, jumper wire, LED, switch, etc.
  5. A Rainbow HAT: for Android Things
  6. Power Supply: with a minimum of a 5volt.
  7. SD card

Getting Started

While there are many boards available in the market but in this article, we will mainly focus on Raspberry Pi 3 because it is very reliable.



1. Assembling the Hardware

Plug the Rainbow HAT into your Raspberry Pi. Make sure the pins are lined up and not off by one row. and then connect it to the power supply.

2. Installing Android Things:

sudo ~/android-things-setup-utility/android-things-setup-utility-macos  

3. Connecting:

For Raspberry Pi, you will need an HDMI monitor, an HDMI cable, and a mouse. Follow the steps:

adb connect ip-address # your ip address 

You will be connected to the internet. 

4. Exploring Android Things Projects:

Update your SDK tools. Import Things library. Android Things library will be included and the android manifest file will already be updated with the IOT_LAUNCHER intent filter so that it launches automatically on boot.

provided ‘com.google.android.things:androidthings:0.1-devpreview’                                

 and in android manifest

<activity android:name=”.ButtonActivity”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
<! — 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> 

5. Communication with Hardware:

Android Things helps in communicating between the peripherals I/O API and the sensors and the actuators.

Article Tags :