♫ These are a few of my favourite (Android) Things ♫

0 0

yeah hello room my name is Marcus black owner I'm a developer evangelist Nicolle Twilio just out of curiosity because I see some familiar faces there who doesn't know what silly ways okay cool so Twilio is a communications API that helps developers like yourselves adding SMS messages voice chat and video into the applications you always ability we have libraries for all of our eyes decays and all of our Oliver a pea ice so you can just very much you know if you're a developer for example you can just very much add the new get packages into your applications and then you can get starts using video but this is not a even though we do care a lot about IOT this is not a Twitter talk okay if you want to know more about Twitter we have a booth downstairs in the third floor it's next to coffee stand so if you don't know more about till you just come and talk to me about it and I'd be more than happy to talk to you so today I'm here to tell you about Android things I just want to kind of take some stuff out of the way Android things is this new platform I there's some information about me on the screen I will be tweeting these slides later so you don't need to worry about making notes or like taking pictures or anything if you don't want and I also run Android things like rocks which is a website or about Android things but let me just tell you a little bit about what Android things actually is because so far you may have had some experiences with Android which is like you know on the phone and Android running on a watch maybe sometimes you've seen it on a screen maybe your TV maybe a car but Android thinks is an extension of Android that lets you move away from these things and actually have on drug running on different devices I am going to talk to you about some of the devices I'm going to show you some cool demos as well but I want to I want to tell you what kind of applications you can use Android thinks for who's an under ed developer here ok so not everyone that's fine like you don't need to be an Android developer to get starts with this but basically the some of the applications Ranieri things right now things like cameras in gateways in points of sale there's people using their own security systems like you know if you want to build a security system one that really sytze me is fleet management so there's people actually trucking fleet like you know their trucks and everything and they have a they have an Android device that kind of you know it can talk to androids also and everything but this is a IOT device that lives inside a truck for example and and that's exciting because there aren't that many different ways you can do this kind of thing right now okay so there are some IOT devices out there there are some Arduinos and everything but all of them have their own limitations we are going to talk about limitations today okay so my whole premise here is I just want to be honest with you and tell you what this what this thing is about but why is Android things actually different because as a sort of like an IOT enthusiast I have always been of the minds that okay so I can get my Arduinos and then there's something else that comes out there's like the esp8266 and then you know suddenly you're like in this deep end of learning C++ and you you know you're kind of going back to university times where it's like for me it's you know like C++ is okay it's fine but this is not what I work with okay this is not the language I am most proficient with whereas when it comes to something like Android for example yes I've been an Android developer for a while so for me to be able to use the skills I know and transfer that to go elsewhere so transfer that to go to a device is very powerful and this is not just like a telephone now this is something else this is a different board okay some of the things that are worth mentioning on when it comes to Android things is everything that I'm like all of the logos I have here are the logos that an Android developer will know about okay so you have the Android studio there of the androids you know firebase have Google clouds you have Kotlin so this is all of the stuff that a an Android developer who already have okay and you know fan is when you install the the first one in there which is under its video most of these other things kind of combine those with its okay so there's no like setup there's no special setup or anything but I'll show you how to actually take a device and make sure it's got Android things running on s because obviously we will be looking at devices that don't thoroughly come with Android things and you can install it on them so let's talk about this let's talk about where Android things actually runs okay because you know this um like we have a we have a couple of different boards and I kind of wanted to go through some of these boards okay I'm sure some of you may have heard about NXP as a board and and an XP they're like really big right now when it comes to sort of like home automation and they're becoming really big when it comes to like IOT like just building IOT and and busy for the Internet of Things but the one thing that the the one thing that nxb kind of like falls short in my opinion is there's not really a massive community behind them okay so when you get stuck on something when you're like I don't know using a board like this for example and you get stuck and you have a question there's not really that many people who can ask because they don't have a massive community but you know what guess who's got a massive community these people here raspberry pie they do have a a really big community they have been out there for a while and and the good news is Android things runs on the Raspberry Pi 3 so the Raspberry Pi 3 if you if you haven't got a Raspberry Pi 3 right now the Raspberry Pi 3 is sort of like the latest addition to the to the raspberry PI's and the cool thing about this is like it's got a very decent processor in it it's got some very decent ram so it's got some very distant memory and it's about 35 pounds ok so you're not really making a massive investments because this is the other thing as a hobbyist so I'm not a I'm not a an electrical engineer or anything so as a hobbyist for me it's kind of hard to say hey I'm gonna pay 65 pounds on a boards I don't even know if I'm gonna use it I don't even know if it's gonna work you know with the Raspberry Pi if it doesn't work it can always turn that into a video game or something so I can always repurpose that so there's there's different things you can do with this but there are more reasons so one of them I mentioned right there's a massive community behind this okay there wasn't a single time when I got stuck with a Raspberry Pi and if you go down to my booth you see I'm actually using some raspberry PI's on the on the big screen there there wasn't a single time when I was stuck the problem with the Raspberry Pi and it couldn't find an answer like they have a massive community they have four ins they have everything so it's kind of cool to be able to rely on this okay the other reason I like the Raspberry Pi is cost okay I am I am okay having a Raspberry Pi behind my light switch or a Raspberry Pi behind my door I'm not so okay you know with literally having a bunch of money like you know paying hundreds of pounds in a boss that is gonna just stay there okay I'm not like this is you know it's a kind of a waste of time and it's a kind of a waste of money for boards it's just staying there it doesn't do much or it doesn't you know it always does the same thing the other reason is and the other reason I chose the Raspberry Pi personally is you probably already have a Raspberry Pi on that junk drawer that you have in your house okay a bunch of people got excited about raspberry PI's there's you know small computers and everything and yes you know I buy every single one of them when they come out I don't know if I'm gonna use them but I buy them so you probably already have one but this is you know this is my choice obviously there are the other boards there are differences on the boards and everything but one of the things I want to point out on the boards themselves is if you are building for scale if you are building I don't know like a fleet management for example you probably want to go with one of these boards here and the reason you want to go with one of these boards here instead of the Raspberry Pi is the Raspberry Pi is great for hobbies the Raspberry Pi is great for like coming up with prototypes when you want to go professional what do you want to do is you want to come out of the boards and you want to get this bit here which is the processor so this is where Android thinks is gonna run okay and if you want to create your own boards if you want to create your own your own products you probably want to go for one of the NXP boards okay we are not talking about going professional here we're not talking about you know Asset Management's or anything we're talking about let's just get started let's just get stuck in and you know you can get your codes that runs on the Raspberry Pi and run on any of those boards as well there's no difference okay so this is a this is super good because you can basically use all the pins and the headers and everything you get here and once you're ready if you want to go to production if you want to productize then you can go to one of the and then you can start analyzing things like okay so what's the process or how much rum do I need and everything so you can start think about these things but sort of going back to how to get started okay getting started with Android things is really really easy the first thing you're going to need is obviously one of these boards okay like I said you can get a Raspberry Pi for 35 pounds or so depends on where you buy so it's easy to get one you know if you go to Amazon you can find a Raspberry Pi now the next thing you're gonna need is a memory card so memory cards is gonna go on the Raspberry Pi and the other thing it needs is obviously Android studio so remember I said most of the logos I showed you back then you know with the android logo and katli and everything when you get Android studio you get those things embedded in Android studio okay so you don't need to do any setups or anything and and that's basically what you're gonna need okay now you need to have the you need to have Android things actually installed on this on this Raspberry Pi and the process of getting those is simple there's a there's an installer that you can download so if you go to the Android things website there's gonna be a link so there's a console you can log into that you can log into the console and they're gonna give you a command line application that you can use to install Android things into your memory cards so it's not a like you know downloading something and they're just writing a bunch of commands you're just executing something so you're executing something like this which is your which is your setup and you have an option to say hey I want to do Linux or depending on which computer you are in this case I'm on a Mac and it will give you the options what you want to do then you get you've got two options this is again this is with this memory card just plugs into your computer okay we're not doing anything on the Raspberry Pi itself yet so it's gonna go and ask you what you want to do do you want to install and dry things and optionally set up Wi-Fi or do you want to set up Wi-Fi in an existing Android things so we're gonna go for option one here which is we want to install Android things now the next one is what hardware are you using again this is giving you the options of which harder you want to go for you don't need to do any manual downloads anymore you can just go through this and it will it will download the stuff for you again so we're using a Raspberry Pi so we're going to go for option one so we use the we chose the Raspberry Pi 3 and now it's gonna ask you do you want to use the default image or the custom image and this is really cool this is the part that really excites me okay because I talked about productizing and everything when you go with the default image this is the basic image this is the vanilla Android things image but as it turns out you can create your own image so if you have applications running on on Android things right now if you have created applications you can run you can basically build your images around this so when he sets up different devices you can use your other images so you can use your custom images okay so in this case we're not using a custom image we're just going for the default image okay it's worth noting as well that when you have Android things installed on a device because it's connected to it's connected to your Wi-Fi or whatever you can send you can send push updates to it you can push your updates to it as well so you can do over-the-air updates which is also quite nice and many of the other IOT things don't allow you to do that and then so we chose we want to do we chose one of the number one and this is gonna go like in download stuff for you so it's downloading Android things for you so you don't need to know which version you want to go for it just does it for you and then it flashes okay now the one thing about flashing and everything is this is going way faster than it actually goes okay I had to speed this up because otherwise we would take the whole hour here to to show you that and then at the end it will go ahead you want to set up Wi-Fi and this is basically when you're going to set up the Wi-Fi for this device if you want to skip it you can skip it and then you just go to when you're ready to set up the Wi-Fi you can just go and set it up okay option 2 on the on the very beginning you can just set it up worth noting if you want to have it plugs into a an Ethernet cable for example then Co you can you can also have it plugs into a cable now I said this before but it's important to keeping my that when you install this it is gonna take forever okay like forever is it takes about 20 minutes to go through the whole process right and this is why I had to speed this up so it takes a while I also I suggest when you're installing this just let it go just let it be and when it's done it will tell you one then now you know you can start using but once once you're done you're gonna be presented with a screen like this okay and I say you're gonna be presented with a screen like this because you will need to plug this thing to something like you need to plug this to an HDMI monitor for example you need to plug it into something so you know what's going on it's not completely necessary for you to plug it to something if you know what you're doing but I like to always plug it to see that okay I've done the installation and it's so good like it so good stuff and everything and in this case I'm connecting to an Ethernet cable and because I'm connected to an Ethernet cable I've got an IP address already okay but this is all like the theory and everything so I feel like I should kind of show you a little demo of how this thing works okay and this is obviously where things can go wrong but I have a backup in case things go wrong so I'm going to come out of my presentation mode here and what I want to show you is I have I have this little camera here and this camera is right here okay so you can see my finger here and I have a Raspberry Pi there so I have a Raspberry Pi it's a Raspberry Pi with a button it's plugged into my computer so it's all set up it should be running it runs as an Android device what we're going to try to do is we're going to try and build the simplest application ever and we want to make sure that okay we've got everything that is needed to run this thing so I am gonna I am going to reset my I'm gonna reset what I have in my codes here so I'm gonna end up with nothing okay well I'm ending up with a sort of blank Android application I didn't want it to go through the process of seeing me creating an Android application because it's basically new Android application so this is what you end up with the first thing you're gonna do is you're gonna import Android things into it so importing Android things so it's compiled only then Android things latest version of it and I'm also gonna bring in a button which if you're an Android developer you will know that there's a button library inside of Android and this is the widget so this is basically when you use a button in your application this is a different kind of bus and this is a driver button okay we'll get to it in a second you understand everything but for now just stay with me and I'm gonna sink it and the next thing I'm gonna do is I'm gonna go to my manifest because Android things only ever runs one application at a time so unlike your telephones for example you have mobile applications running with Android things what you're gonna find is that sometimes they don't actually have a screen so when they don't have a screen how these how do you go and switch applications so Android things runs best as a single application device the other thing about it is sometimes they don't have a screen sometimes you don't have a button sometimes this is only that thing that is behind your door and it's doing something so you want to make sure that when you start your Android application you want to make sure that you start the application as well because there's no user interaction there sometimes and and the way you do this is you just create a new intent so I'm gonna create the IOT intent so this is basically me saying hey when my androids things device boots up I want to start this application that's the first thing I'm gonna do just go ahead and start the application now again I have a blink activity here if you're an Android developer you know this is what you end up with when you create a new Android a new Android application okay so blink activity so this is just a blink class and what I'm gonna do is I'm gonna check what GPIO I have and I'll tell you all about GPIO s but if you want to know right now GPIO s are basically all the pins you have access okay so these are the general inputs and outputs pins that you have access in this device and I want to check them out so I want to see which ones I have okay so I'm gonna start off by creating a a variable here I'm using calling by the way you can use Kotlin or you can use Java it's up to you Colleen is my preference but you can use either one of them okay everything you will see here including the links there will be there will be links to repositories where you can see the codes and you can also see the Java code in that if you want so it's it's really down to preference here so I'll create a variable called service and on this variable I'm gonna use the pre fro peripheral manager service okay so this is basically bringing the peripheral manager service from the Android things package and I'm gonna do a real simple thing here which is GPIO s and now I wanna do service that GPIO list okay so I just want to show that I have a list of general purpose input and output items here so I'm gonna run that as you can see it's already picked up that I have an Android device connected again the Android device is this little Raspberry Pi here okay it is it has been configured with Android things so it's already picked up and now when I press ENTER it's gonna do its magic so great I was like trying to build this thing and hopefully the Wi-Fi will help as well because this relies on the on the Wi-Fi right now and it's installing the apk so now it's launched and you can see at the very bottom here it says GPIO is on sorry it's really small but it says GPIO s and then you have a list of all the GPIO so you have a list of all the pins okay so this tells me cool that thing is working like it's installed okay so that's the that's the first part of its but we're gonna carry on we'll come back to these in a minute so like I said I did have a backup just in case mine's in more so this is just a video that shows you how this thing would have worked but you know it works so we're all good but the one thing that you will know is so far we have been very hardware free like we haven't really done anything with this like we have a Raspberry Pi there's a button connected to it but we haven't used like we've only just like boots at this application and we haven't actually used the bus and we haven't done anything and this is the part where I feel like if you have never done anything to do with IOT if you have never built any I don't know robots or like devices or anything this is the past where like I I feel like I should tell you what some of the things are so we talked about the peripherals before the peripherals again these are the inputs and outputs pins that you can use so this is basically what's in a Raspberry Pi okay so you have some voltage places here like 3.3 volts and 5 volts grounds and you've got the all of the BCM s here are the pins that you can use for inputs and outputs then you have some different things like spi and you've got you've got PWM so depending on what you using the pending on what kind of device so depending on what kind of hardware you using you will need to use different buttons or different pins on this okay so when I say GPIO just think about these pins here the next thing is bread boards so I think that the and you're gonna come across these things when you start sort of playing with IOT so bread boards is basically a blank canvas where you can do all of your prototyping and everything without having to solder anything if you have done any soldiering before you will know that it's a it's a kind of a one-time process like if you mess it up you can you know you can this solder it but it's a kind of a one-time process so I usually say starts with a breadboard because if you literally just pluck your your your cables in it can use it and you're not doing any soldering okay once you're a hundred percent sure of this and you want to turn that into a nice-looking boss then you can do all the soldering jumper wires again jumper wires is what's gonna go between the breadboard and your devices this could be maybe the pins in here or this could be something else this could be like a sensor or something resistors are you know they help us with reducing the flow so if you have this is basically a way for you to control resistance like if you have a 5 volts for example when you try and push 5 volts into an LED something is gonna happen blaze basically some black smoke that it's gonna smell really bad it's the same idea of like having a hundred ten volts and you connect it to one hundred two hundred twenty volts something is going to burn or explode then one thing that is really important about resistors is and I found you know I found this out the wrong way or the hard way the colors actually met her okay colors are important so they're not just good looking things with like nice colors colors actually messes so there's values in them and there's websites that help you learning these things I feel silly saying this now but yes when I started I was like oh my god they're all the same like there's just a bunch of resistors and they all have nice different colors colors actually matter okay so this is the resistance that you can apply and LEDs the blinky things okay so I think we've all seen or plays with LEDs but they're basically the the blinky things like you know the lights light bulbs and stuff now the other thing that you are going to come across is you're going to come across some of these schematics just like this one so this one is called freaks Fritzing and Fritzing is a free open-source application that helps you come up with schematics just like this okay now the good thing about this one is it's very visual so even if I have no idea what I'm doing when I look at this I can literally just so this is like you know copy and paste I can literally copy stuff from here into my breadboards and it will work usually so Fritzing is basically what you can use to I don't know if you build a library for example you can use Fritzing to actually show people how to connect how to plug things in some of these schematics you're gonna see out there are way more complicated than Fritzing but Fritzing is a way for especially people who are like starting now it's a way for them to you know learn it's a way for them to be able to understand so you will see a bunch of those examples especially in android things you will see a bunch of these examples using Fritzing now we're gonna try and emulate this sort of like how this thing works so I'm gonna put up another demo here and on this one we're gonna we're gonna stay here on the same place we were before what we are going to do though is we're going to create a variable for our button okay remember with with imported buttons here okay so we're gonna create a variable for it I'm gonna do this as lay in it and I'll call this button and this is going to be of type button again if you are an Android developer you will know that Android widgets is the regular button that you get in an application for hardware you shouldn't be using the widgets you should be using the driver button because we're going away from the screen we actually have a physical button here so we're going to select the second option here so we now have a button now what do we do with the button we can initialize it and with this birth so we're gonna go button and button asks for two arguments it asks for a pin so pin again going back to GPIO so it's just the pin number of that specific GPIO I have in this device here so as you can see I don't know if I can zoom in yeah I have no idea oh maybe I can yeah that's right cool let's make this bigger as well so so I have my wires sorts of them connected to three pins here one of them is the GPIO and the other two the blue and the red are the positive and the negative okay so this is what the this is what the pin consists of in this case we'll come back to this in a minute so I know by looking here I know that my button is connected to pin B cm5 so I'm gonna say cool this is connected to B cm5 and now I want to say what happens when I press this button like what sorts of logics the logic states do I have when I press this button so we're gonna go logic States so I've got a button so logic state I can have pressed when low so one a thing I want to say this button is pressed when I really press it or pressed when high so this is basically me saying I want to do something when the button is down not when the button is up because you could do something when the button goes up as well so we're just saying pressed when low so when the button is down I want something to happen now I'm gonna take this button and I'll just create an event listener so again same thing in every single language like I'm just gonna go and create an event listener so in this event listener I want to do I'll just get this so now instead of starting the application and writing to the bottom how is it like we didn't hear I once that every single time I press that button I want to log a message okay so again super simple but it kind of goes to show you that yes it is meant to be simple it's meant to be that simple like there's not you know there shouldn't be any magic here so I'll go ahead and run this again and this is probably gonna like remove the activity ball it's gonna kill the activity and then it's gonna install it again so it's like it's falling right now and then as you can see you look at the bottom here and nothing really happens like you don't have that log anymore like you can't see that log anymore and the reason you can't see that log anymore is because we haven't really pressed a button so hopefully now again my fingers here when I press the button you should see that something happen at the bottom right there on the logs so that's the best source of viz okay so I'm like controlling a button now I have something else the the hardware that you see here is basically the same kind of harder that you've seen on my slides on that Fritzing thing so I've got a resistor there I've got a button so this is just like a bigger blue button but it's the same idea okay and I'm just plugs into three places I've just got my my think plugs into three pay places and this is what the breadboard is okay it's just a different color as well so now we can control buttons right and you see where I'm going with this in a minute so let's go back to the slides and again I had a backup for this just in case it didn't work but let's just have a look at the codes let's have a look at what we have because of this I I kind of feel like when you when you're dealing with especially external hardware like you know dealing with software is fine because software doesn't change as much as Hardware when it comes to you know the vendor where you're buying that harder sometimes you have the same hardware which is supposed to be the same thing but it works in a slightly different way okay like sometimes they have a button that works and it slightly differently so out of these codes what is really managed by Google and what is really managed by the user by you know yourself or the developer so we looked at the first part so calm Google Android things so the the core of Android things is actually managed by Google okay so Google came up with this whole thing now the button which is the second part if can read that it says Android things that contrib dot driver so this is a contribution driver so this is someone who wrote a driver for a button okay and and the beauty of it is the drivers are open-source if you don't think the button works the right way or if you don't like if you know happy with the way it works or whatever you can just go and make a pull request so the drivers are open-source and in fact what's been happening is a bunch of people have been writing drivers so these are the current contrib drivers so there's stuff like GPS for example there's a there's a temperature sensor there's an LCD display their servos and there's quite a few there's a so the one in the bottom is a speaker so you have a bunch of different drivers okay but what will happen eventually is these lists of driver which is not an extensive list right now but these lists of drivers eventually you're going to find yourself needing something else you're going to find yourself needing some different driver if you are leaving source of like the arduino world when you need a drip when it needs a different driver you basically unless it really goes with c or c++ you're basically screwed okay now in my case i wanted to you know i wanted to see if it was possible for me to create to create different drivers and I found someone wrote a blog post showing people how to write your first Android things driver and then I had this idea that I wanted to build something like this this is a binary clock okay so it's got a bunch of LEDs there it's got 18 LEDs on it and I wanted to build this I wanted to build something that looks like this and I was like well I think Android things is like kind of the way to go okay so I found that to run a binary clock I needed a bunch of GPIO s so I could communicate with all my LEDs and why are the Androids why are the the Arduino the sorry the Raspberry Pi board has a bunch of outputs and inputs I was going to have a bunch of wires running over it it was gonna be a mess okay so I wanted to do it in a way that even if I wanted to have two binary clocks running or three binary clocks running I would have enough GPIO okay and I knew the raspberry PI's don't have an F GPIO so I found this thing here we'll just go to max seven two one nine the max seven 209 is basically a an LED driver that lets you drive up to 64 LEDs and you can also change them so you can have if you have two 128 so you can keep on training them up to I think seven so that's like a lot of LEDs okay so I found that and I was like perfect this is what I want but there was no driver for it okay so I went ahead and created my own driver again I used the language I already know I used Android to create my own driver so this is all written in I think this one is returning I wrote this one in cotton yeah so again it's the language I know and it's the language that I am most comfortable with so I just built a driver for it I went to the documentation I saw how the thing worked again I'm not an electrical engineer so I had to you know spend some time looking at this but hey I built a driver and and the lesson here is like it's really not that hard like it's actually quite fun being a driver like they especially I'm gonna get it working it's actually quite fun now in terms of what is managed by what so the stuff that is managed by Google and the differences between having Android things running on a device like this or having underthings running on a phone is this this is what Android this when it runs on a phone now when you move to Android things you will notice that some of these things disappear because obviously now you can't use your Raspberry Pi as a phone like even though it's running Android you can't use that as a phone you can't use that for messaging your concepts or calendar wallpapers like this is not what this thing is meant for okay this is meant to be a device that helps you building you know Internet of Things as opposed to like just building your phone if you want a phone you get a phone obviously you know there's like as you know the lower you go so you've got the application framework and then you've got the Linux kernel which is basically the same one that runs on Android right the cool thing in here is this place are completely optional and I know I told you like you know when you set up your Raspberry Pi you might want to connect that to a display just to make sure everything is working but they are option okay so you can completely survive without a display the other thing here is if you don't have a screen like if you want to if you really want to test it out where you don't really have a screen you can use applications so this is this is an application called visor so if you don't have like an HDMI display or something you can use applications like visor to connect to your Raspberry Pi device and again in this case I'm showing like I'm running an Android application which I'm gonna which I'm going to talk to you about in just a second so this application is called doorbell so you can also mix and match which is I find this really cool like you can you can have a display so the Raspberry Pi has displays like external displays they can connects to it and they're also touchscreens so you can have both like you can have a Android things device like a Raspberry Pi device that has a an interface components ways which it will build just like your built in Android but you can also do the hardware part of it so you can mix a match which is kind of cool so like theoretically you could every you could have an external button just like this but you could have an application just like that that has a button in it as well and they both do the same thing but let's just look at let's just look at another demo and this all of them always one favorites of mine and I'll tell you why because obviously the demos I showed you today they're like you know they're not they're not really real like you know you know you're not gonna spend your life just building hello worlds with Android things but the next one is a real one for me so the next one is when I built when so I work from home most times I work from home and when I work from home I listen to very loud music okay listening to very loud music means whenever there's like a postman at the door for example I don't hear them like I never do I'm on the first floor of my house and I just don't hear whenever there's someone at the door I just don't hear them so what started to happen was I was getting those like notes asleep saying well yeah your postman came over you weren't here so now you need to go back to the post office and get your stuff and this is getting annoying you okay cuz like I was in the house but I would never I would just never hear the postman so what I thought oh okay so I I'm not downstairs and I'm not gonna stop listening to music so like it's impossible for me to know that the postman is at the door however there's one thing I always have in front of me when I'm like when I'm working which is my phone so I miss the postman every single time but if you call me I never miss a call because my phone is always in front of me and I I bet everyone works with the phone in front of them so if you don't want records because you don't want to answer but you know my phone is always in front of me and I was like can I do something about this like can I build something that maybe when the postman rings my doorbell I get a call and that's what I built so back to I'm gonna stop this and I am gonna go ahead and remove so remember I said I said Android things is a kind of a one application only thing so what I did here is I just uninstalled this application and I'm gonna go to another application I built and this one is called doorbell things and what doorbell things does is again it's an application just like the one you've seen before it has a if you it has a has an interface for the doorbell so this is basically how this basically the API use to make an external request to an external service like a you know make an HTTP request okay now I built this service application here and what it will do is every single time you make a get request to this application I built and when you make the write get request and you're passing the right things this is gonna call my phone so I'm gonna get a call so every single time you make a get request I'm gonna get a call in here so the way this thing works is super similar to the one we had before so I have a initialized doorbell button which pays you know initializes this doorbell Pressman low same kind of thing we looked at before and when you when you initialize that button we initialize retro phases also retro face is the thing we're using to make HTTP requests and we have an event listener for this button so every single time we every single time we push this button we're just making an HTTP request and we're making the HTTP requests on the way that my application my server let's application on the other side will know and will know to give me a call okay so if I now run this application on my device on my Android things device so imagine these okay it's really hard to show you because like I wish I could just bring my door here so you could see my you know my doorbell and everything but just like you know imagine this this is like my door and the postman comes over they've got a they've got a letter for me this is what my doorbell will look like okay so this is this is roughly what my doorbell would look like and I also have my phone here which I should try and put it somewhere there okay so I think you can see so now this is the this is the the postman coming over and the postman goes and rings my doorbell okay so you may have seen at the bottom there says but buts impressed and hopefully again if the Wi-Fi is working yeah I get a call so I answer this call and it will say there's somebody at the door so the cool thing about this is again this was a fairly cheap thing for me to build like I could have gone invoice one of those like fancy ring doorbells and everything but it's not the same kind of fun like it's not as fun as actually abusing my own thing like I I built a doorbell how many people can say that so this is like you know this is where I I kind of go crazy with my ideas and and start like building stuff like this so obviously you know I went and I built a doorbell but I also built I also built some different things with this the other one is how to build a high-five machine with Android things so what I wanted to do is every single time I got a like on Twitter again that person works from home and doesn't really talk to people every single time I got a like from Twitter I just wanted to get a high-five so I built a high-five machine that basically listens to my Twitter accounts and whenever I get I like I get a little high five the other thing I built was controlling your office lights of Android things so this one is basically plugged into my hue light so I've got the hue light bulbs at home and I built something that I can press the buttons and again these are all like blog posts so under things like rocks you see all this all the codes and everything for this but I built this thing that obviously I can say Alexa turn the lights Reds I turned the lights green but I just wanted to go back I just wanted to go like analog and I was like can I press a button it sounds like green as it sounds out so you can because the hue lights they have an API and I can just make requests to the API so you know some of the things are going to be more useful than other things but it's like what is useful to you may not be you know useful to me but it's cool to be able to have these options and have things that you can play with on that again Android things is the power of Android it is managed by Google okay so the part that is managed by Google is really important and the reason I say managed by Google is important is if you are doing over-the-air updates for example you want to make sure that your over-the-air updates are secure you want to make sure that no one is intersecting that you want to make sure that no one is actually taking charge of your IOT devices as you know instead of you like we don't want to have an output another botnets accident or something like this so this being managed by Google kind of stops that unless people get access your Google accounts and it's also automatic and secure and yes with that I've been Markus Percona there's my Twitter accounts there's my github accounts all of the codes that you've seen here you're gonna be able to see them I get hub accounts and I also run Android things like rocks and if you want to come and talk to me about the Esso you want to go comment on my box video downstairs just by the coffee place thank you very much [Applause]