
Google had introduced yet another OS as known as “Android Things” that is designed to run on light embedded devices and offers the framework with Java to handles peripherals. My idea was to invite the Android Things framework to ODROID and let users use the expansion pins easily. But the problem is that the Android Thing is not open source not like other Android OS therefore I had to implement the code in the Android for ODROID. Fortunately, Google opens the framework APIs with its document and Android Things SDK. This fact encourages me to implement the full stack of the framework that works like what Android Things do from bottom to top.
I use some apis from the Android things’ Peripheral managing parts. Android things has many other features, but that is not needed yet to the odroid. I made interfaces for using android things api. and for processing and managing the request from user layer via API, I build the server and client architecture and connect it to the hardware layer via the wiringPi to control real hardwares. First of all, GPIO, I2C and PWM features are implemented. because people use it more often than other features like spi and uart. Explaining all of the implementation is best, but I will just show you how to use it. that are more useful. I don't want to waste your time.

I made it by reverse engineering. As a result, it can be incompatible and degrade performance. But I expect that users who previously wanted to use GPIO pins on Android will relieve some of the difficulty of working in C or script by my work. Let me show you an example of android things about GPIO, I2C and PWM to learn how to use it.
[Android Things Implementation Architecture diagram]
There is nothing as simple as using the Android Studio to create, compile, and test an application or service that contains Android Things feature. You just need to install the Android studio, and add official option and official code to use android things, and install a package to odroid via otg port. and just execute a package. It just works! That's all. you don’t need to do anything else.
I uploaded all of the example code to my github repository (https://github.com/xiane/thingsGpioExample). And each of the examples is just separated by branches. On the master branch, You can control the GPIO pin. On the i2c_16x4 branch, you can use 16x4 lcd through I2C. On the PWM branch, you can control the PWM. and on the i2c_weather_board branch, you can use a weatherboard. Please use and test it for your help.
All of the behind code is based on the android thing official site. Please check the official site. https://developer.android.com/things