Rebecca Franks introduces Android Things, an extension of Android for building IoT devices. Android Things allows developers to use familiar Android tools to build intelligent devices that can be securely deployed at scale. It differs from Android by being optimized for embedded devices without displays. Developers can easily integrate hardware using APIs like GPIO, PWM, I2C and drive peripherals. The presentation demonstrates building a simple Android Things app to control an LED from a button press and provides example projects for a distributed piano and electricity monitor using Firebase.
7. Android Things is an extension of the Android
platform for IoT and embedded devices.
8. 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 that need to
be secure.
9. How is Android Things different?
Android
Studio
Android SDKs
& Developer
Tools
Firebase
Libraries
Google Cloud
Platform SDKs
Any other
compatible
Android/Java
libraries...
16. Cons
● Only Dev Preview
● Weave not yet available for Android Things
● Very new - Not many examples online - mostly Python
● Some APIs not supported - ie hardwareAcceleration
● Closed Source
19. LEDs - Emits visible light when an
electric current passes through it
Push Switches - Allows electricity
to flow between its two contacts
Components
20. Resistor -Used to reduce current flow
Source: http://www.electronicshub.or g/resistor-color-code/
Components
and many more...
21. Ohm’s Law
The current through a conductor
between two points is directly
proportional to the voltage across
the two points.
V = I * R
V is Voltage (volts)
I is Current (amps)
R is Resistance (ohms)
I = 0.023A
V = 5V
R = 5V / 0.023A
R = ± 217 ohms
28. ● A Raspberry Pi 3 or alternative - Running Android Things
● Create standard project in Android Studio
● Add to app level build.gradle:
provided 'com.google.android.things:androidthings:...'
Getting Started
31. //get access to the pin
PeripheralManagerService service = new PeripheralManagerService();
ledGpio = service.openGpio("BCM6");
ledGpio.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW);
ledGpio.setValue(true);
//remember to close the peripheral
ledGpio.close();
Turn on an LED
32. Turn it on or off using Firebase Realtime DB
FirebaseDatabase.getInstance().getReference("ledKitchen")
.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(final DataSnapshot dataSnapshot) {
Boolean value = (Boolean) dataSnapshot.getValue();
ledGpio.setValue(value);
//.. handle exceptions
}
//..
});