nest_tutorial
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
nest_tutorial [2017/01/03 18:21] – created dwallace | nest_tutorial [2017/02/09 13:46] (current) – dwallace | ||
---|---|---|---|
Line 7: | Line 7: | ||
**Keywords: | **Keywords: | ||
\\ | \\ | ||
+ | \\ \\ | ||
+ | {{ youtube> | ||
+ | \\ \\ | ||
+ | |||
+ | This tutorial is the first part of a series of tutorials on Smart Home development. This tutorial serves as a starting point for Nest development using Android. Nest development can also be done with iOS and Web, but we will not cover these in this tutorial. For more info on those, see the [[https:// | ||
+ | |||
+ | ===== Overview ===== | ||
+ | |||
+ | The [[https:// | ||
+ | |||
+ | In order to interface with the Nest API, we need to utilize the [[https:// | ||
+ | |||
+ | The app that we will create will utilize the Nest SDK to send Firebase commands to the Nest API in order to read and write the data of the Nest API/JSON document for our Nest home. In order to have a secure connection and ensure that user data isn't compromised, | ||
+ | |||
+ | ===== Downloads ===== | ||
+ | |||
+ | First, you will need to download some tools and SDKs to start working with the Nest products. The first program that we should install is [[https:// | ||
+ | |||
+ | Next, we will need to download the necessary Nest SDKs. For this tutorial, we will be using the sample code which is provided separate from the main SDK, because this is easier for setup. The sample code can be found [[https:// | ||
+ | |||
+ | ===== Setting up a Nest Client ===== | ||
+ | |||
+ | Once you have downloaded the necessary tools and SDKs, we will need to set-up a Nest client for our app to use for authentication and permissions. To do this, first make a [[https:// | ||
+ | |||
+ | Now, we will create our Nest client. To do this, we will head to the [[https:// | ||
+ | \\ \\ | ||
+ | {{ dylanw: | ||
+ | \\ | ||
+ | |||
+ | Here, you will need to fill in the basic info for your app. Fill in the Product Name, Description, | ||
+ | |||
+ | Next, we will need to provide the permissions for our app to use. To do this, we will simply add the necessary permissions on the product page. For testing purposes, it is best to give all permissions to ensure that everything is working. Your permissions section should end up looking like this: | ||
+ | \\ \\ | ||
+ | {{ dylanw: | ||
+ | \\ | ||
+ | |||
+ | Once you have made these adjustments, | ||
+ | |||
+ | ===== Setting up the Android Studio Project ===== | ||
+ | |||
+ | Once we have set-up the Nest client, we can then move on to creating our app. For this tutorial, we will be using a sample app provided by Nest, in order to make understanding easier for future development. | ||
+ | |||
+ | First, open up Android Studio and choose to " | ||
+ | |||
+ | Once, you have successfully imported the project, we need to make some changes to the Constants file. This can be found under java/ | ||
+ | \\ \\ | ||
+ | {{ dylanw: | ||
+ | \\ | ||
+ | |||
+ | Once you have modified these, clean and rebuild your project to make sure that everything is working properly. If so, then we can move onto deployment and testing. | ||
+ | |||
+ | ===== Deployment ===== | ||
+ | |||
+ | Once we have set-up the Android Studio project, we can then move onto deploying it to an emulator or Android smartphone. If you have a CPU that supports hardware acceleration, | ||
+ | |||
+ | In order to deploy to a physical device, we have to ensure that both Developer Mode is turned-on, and that USB Debugging is turned-on. To enable Developer Mode, go to Settings > About device and tap the Build Number field 7 times. This will ensure that Developer Mode is turned on. To enable USB debugging, plug in your device to your computer, and Media Device Options card in the Notifications bar. Disable and re-enable the device as a Media Device, and then it will prompt you to enable USB Debugging. Check to " | ||
+ | |||
+ | Now we can deploy the app to our device. To do this simply press the Run button. It will ask you to choose which device to run on, so choose the device you just enabled. It may prompt you to install the same version of Android as your device to enable Instant Run. Do this, and wait for the install to finish. Once, you have done this, press Run, and Android Studio will build the project and deploy it onto your device for you to use. | ||
+ | |||
+ | ===== Testing ===== | ||
+ | |||
+ | In order to test our app that we have created, we need some Nest devices to interface with. If you already have Nest devices, then you are welcome to use those for testing. However, for most it is easier to utilize the Nest Home Simulator to emulate virtual Nest devices for testing. | ||
+ | |||
+ | To do this, we must first install the [[https:// | ||
+ | \\ \\ | ||
+ | {{ dylanw: | ||
+ | \\ | ||
+ | |||
+ | Here, we can add virtual Nest devices and even virtual " | ||
+ | |||
+ | Once you have setup the Nest Home Simulator, and your app is deployed, you should be ready to start testing the app! | ||
+ | |||
+ | Now that you know the process, go through the [[https:// | ||
+ | |||
+ | |||
+ | For questions, clarifications, |
nest_tutorial.1483496489.txt.gz · Last modified: 2017/01/03 18:21 by dwallace