User Tools

Site Tools


nest_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nest_tutorial [2017/01/03 23:13] dwallacenest_tutorial [2017/02/09 13:46] (current) dwallace
Line 7: Line 7:
 **Keywords:** Smart Home, Nest, API, SDK, Android, Java **Keywords:** Smart Home, Nest, API, SDK, Android, Java
 \\ \\
 +\\ \\ 
 +{{ youtube>nphZtBLi910?large }}
 +\\ \\ 
  
-{{ VIDEO }} +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://developers.nest.com/documentation/cloud/get-started|Nest developers website]].
- +
-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://developers.nest.com/documentation/cloud/get-started|Nest developers website]].+
  
 ===== Overview ===== ===== Overview =====
  
-The Nest API utilizes a single JSON document to store all of the data about one "structure" or home that a user has associated with their account. This structure then includes all of the devices, and all of the parameters for the devices, as well as user data such as location.+The [[https://developers.nest.com/documentation/api-reference|Nest API]] utilizes a single JSON document to store all of the data about one "structure" or home that a user has associated with their account. This structure then includes all of the devices, and all of the parameters for the devices, as well as user data such as location.
  
 In order to interface with the Nest API, we need to utilize the [[https://firebase.google.com|Firebase platform]], which is an application infrastructure that handles authentication, hosting, and more. Thankfully, Firebase is built into the Nest API, allowing us to use it with ease. In order to interface with the Nest API, we need to utilize the [[https://firebase.google.com|Firebase platform]], which is an application infrastructure that handles authentication, hosting, and more. Thankfully, Firebase is built into the Nest API, allowing us to use it with ease.
Line 30: Line 31:
 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://developers.nest.com/|Nest developers account]]. If you already have a Nest account associated with physical devices, make a different account for development, as we will be using a web simulator that interferes with physical devices on the same account. 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://developers.nest.com/|Nest developers account]]. If you already have a Nest account associated with physical devices, make a different account for development, as we will be using a web simulator that interferes with physical devices on the same account.
  
-Now, we will create our Nest client. To do this, we will head to the [[https://developers.nest.com/products|prodcuts page]] of the Nest website. This page allows us to create custom clients for our app. Your screen should end up looking like this: +Now, we will create our Nest client. To do this, we will head to the [[https://developers.nest.com/products|products page]] of the Nest website. This page allows us to create custom clients for our app. Your screen should end up looking like this: 
-\\ +\\ \\ 
 {{ dylanw:nestproductpage.jpg?800 }} {{ dylanw:nestproductpage.jpg?800 }}
 \\  \\ 
Line 38: Line 39:
  
 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: 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:nestpermissions.jpg?800 }} {{ dylanw:nestpermissions.jpg?800 }}
 \\  \\ 
Line 51: Line 52:
  
 Once, you have successfully imported the project, we need to make some changes to the Constants file. This can be found under java/com.nestlabs.sdk.sample/Constants.java . Here, we will modify the fields according the the data that our Nest client provides. Copy the Product ID from the Nest client to the CLIENT_ID field, the Product Secret to the CLIENT_SECRET field, and the Redirect URI (http://localhost/) to the REDIRECT_URL field. Your file should look something like this: Once, you have successfully imported the project, we need to make some changes to the Constants file. This can be found under java/com.nestlabs.sdk.sample/Constants.java . Here, we will modify the fields according the the data that our Nest client provides. Copy the Product ID from the Nest client to the CLIENT_ID field, the Product Secret to the CLIENT_SECRET field, and the Redirect URI (http://localhost/) to the REDIRECT_URL field. Your file should look something like this:
-\\ +\\ \\ 
 {{ dylanw:nestconstants.jpg?800 }} {{ dylanw:nestconstants.jpg?800 }}
 \\  \\ 
Line 70: Line 71:
  
 To do this, we must first install the [[https://developers.nest.com/documentation/cloud/home-simulator/|Nest Home Simulator]] onto a Chrome browser. Currently this application only supports Chrome. Once you have installed this, open it up, log-in, and you should see a screen similar to this: To do this, we must first install the [[https://developers.nest.com/documentation/cloud/home-simulator/|Nest Home Simulator]] onto a Chrome browser. Currently this application only supports Chrome. Once you have installed this, open it up, log-in, and you should see a screen similar to this:
-\\ +\\ \\ 
 {{ dylanw:nestsimulator.jpg?800 }} {{ dylanw:nestsimulator.jpg?800 }}
 \\  \\ 
Line 81: Line 82:
  
  
-For questions, clarifications, etc, Email: <[email protected]+For questions, clarifications, etc, Email: <[email protected]>
nest_tutorial.1483514002.txt.gz · Last modified: 2017/01/03 23:13 by dwallace