If you remember, the last studio included a demo of a Bluetooth controlled smart lamp. An App was used to control a variety of features:
The objectives of today’s Studio are:
Today’s studio will require groups of four. If you don’t already have someone to work with, introduce yourself to those near you.
Groups of three will be allowed if:
In groups of three the Manager must also take on the responsibilities of the Spokesperson.
Each member of the group should pick a specific role (Manager, Technician, Recorder, Spokesperson) and the role should be different than the role selected last Studio. Each role has some specific responsibilities for the work, but everyone is expected to contribute to discussions and exploration of concepts.
When you get your role, read it over and make sure you are aware of your responsibilities.
As in the previous studios, all group members will need to be in a GitHub group (and repository)
The link for this studio is: https://classroom.github.com/g/Oo9UM2PN
Today both the Recorder and Technician will want to be able to work with the repository (i.e., it should be on at least two computers). The Technician will be working with JavaScript (and HTML+CSS). Chrome and Firefox have developer tools that are slightly better than Safari’s for today’s Studio, so the Technician should probably have access to Chrome/Firefox.
The Recorder should update process/Roles.md
to record everyone’s roles for this studio (use full names). In addition, the Recorder should take notes about the interaction of the overall session.
The Technician should read the questions in process/Debrief.md
to the group, the group should come to a consensus for each, and the Technician should enter the summary for each question.
Today’s studio uses Google’s Material Design Lite (MDL)for styling. MDL was chosen because:
Today’s Spokesperson should open the page for Material Design Lite and review it with the group.
Material design just provides CSS styles, it doesn’t help manage the behavior of the user interface.
Outside libraries, such as Angular, React, and Vue, are often used to help manage all of the complexity of user interface’s behavior. Use of such libraries isn’t needed for this course, but today’s exercise may give you some insight into a few of the details often handled by such libraries.
Applications, including user interfaces, have a “life cycle”. For example, if you’re interested in developing an iOS app, you may use elements of the View Controller Lifecycle to ensure your app is always handeling displayed data correctly.
This class works with relatively simple types of applications and the life cycle elements of interest are often just:
Use your web browser to open the mainLightUI.html
file and examine its user interface. You may notice that you can interact with a few of the UI elements, but that the overall behavior is incomplete.
Note that the App is divided into two tabs.
The Basic
tab provide basic controls for the app.
Set Color
button, which will transfer the target color to the light.Complete README.md
Q1.1-1.2
The Settings
tab will allow users to enable and disable the lights ability to automatically turn off as well as configure the time until it turns off.
s
for seconds)Complete README.md
Q1.3
Review the source code provided in lightBehavior.js
, but do not reload the page or test it.
Complete README.md
Q2.1-2.3 prior to proceeding
Try the page out. If you notice any problems or errors, use some common JavaScript debugging techniques:
redSlider
and redLabel
. Try typing the following into the console:
console.dir(redLabel)
and then expand the details to see all the fields of the redLabel
element. console.dir
isn’t completely stanardized, but in most developer tools it will allow you to examine the details of an element. redLabel.
and review the list of suggested options.console.log()
can be used in much the same way as println()
and System.out.println()
for log-based debugging. It can help you understand the execution of your code.For the remainder of this Studio you need to modify and complete the JavaScript. (You should NOT modify the HTML in any way. All behaviors and initial values should be handled by JavaScript alone)
Complete the prototype so it:
Review your code and try to simplify and consolidate it as much as possible.
Commit your work to GitHub:
Complete any unfinished work and commit it to your repo by 11:59pm Sunday.