We’ve been using HTML+CSS and JavaScript for the UIs for our work thus far. Creating a Mobile app usually requires learning appropriate programming languages (Java/Kotlin for Android, Objective-C/Swift for iOS, and C# for Windows Phone) as well as APIs, development tools, etc. Learning native development for mobile platforms (and the issues regarding mobile app design) requires an entire course itself, but fortunately we can leverage the skills and tools we already know to deploy UIs as Hybrid Apps.
The objectives of today’s Studio are:
Please take your role seriously. When you get your role, review the responsibilities and make sure you follow through on them.
process/Roles.md
)README.md
process/SessionNotes.md
):
process/Debrief.md
Groups of three will be allowed if:
In groups of three the Manager must also take on the responsibilities of the Spokesperson.
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/6RlpNN_9
Today the Recorder, Technician, and the Spokesperson 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 the Photon (C++).
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. Be sure to pull/merge/commit/push at the end of the day!
Today you will be doing the bulk of recording answers to questions. Read the questions in process/Debrief.md
to the group and the group should come to a consensus for each. Be sure to enter the responses. Be sure to pull/merge/commit/push at the end of the day!
The Technician will be programming the Photon and the UI. Consequently their computer will need to be logged into the account for the Photon being used for testing. (Particle Desktop will need to be logged in)
You will be managing the code for today’s studio. DO NOT open it in Particle Dev. Instead create new projects within the repo folder. Be sure to pull/merge/commit/push at the end of the day!
Adobe’s PhoneGap apps are intended to close the gap between phone development and desktop/web development. They create a project structure and allow you to include HTML+CSS and JavaScript for an application that can be submitted to App stores.
The Studio repository already contains both firmware and a complete Cordova app:
lightHardware
is the completed Lamp application (from Studio 8)lightUI
is a completed Cordova AppPrepare your RGB LED (resistors/wiring) and button.
The Technician should load the lightHardware
project in Particle Desktop. Review the source code and modify it to support your setup (RGB LED pins, button pin)
Program your Photon and test your work using the Particle Console. Verify that you understand how to call functions and how the light behaves.
Review the lightUI
folder and sub-folders. Try to identify the basic components and files included.
Complete README.md
Q1
Review the primary .html
file.
Complete README.md
Q2.1-2.2
Update the JavaScript so that it will use your Access Token and Device ID.
Review the primary .js
files.
Complete README.md
Q3
Open the PhoneGap Desktop App and add the project to it:
+
from the side menuOpen existing PhontGap project...
There are a few features of the UI to be aware of:
>
indicates the app currently being “served” by PhoneGap. Currently there is only one app in the list. PhoneGap can “load” multiple apps (the area that says light
is actually a list of apps PhoneGap knows about), but it will only serve one at a time. If you load multiple apps be sure you know which is currently active. (The -
on the left menu can be used to remove apps)Console
tab shows events. If you are using the PhoneGap App on a mobile device, the console.log()
messages as well as Cordova-specific error messages will be shown here. If you are working in a browser console.log()
messages will be shown both here and in your browser’s Console pane. Clicking on this icon toggles the log open/closed.wustl-guest
and another on wustl-2.0
))Open the app in your browser by clicking on the URL listed in PhoneGap Desktop. It should work as it did at the completion of Studio 8. If not, review and fix any errors in the console.
After developing a UI, it can be tested via your desktop browser. This has some distinct advantages:
The PhoneGap Desktop app will automatically push out changes as they occur. Open the primary HTML file and make a small change, like changing one of the labels. For example, change the button that says Set Color
to say Change Color
. You may notice that your webpage automatically reloads.
Unfortunately PhoneGap for iOS was removed from the App Store in the past few days. If you either happened to get it prior to removal or have access to the PhoneGap App on another platform, proceed to test your work via the mobile app.
Open the PhoneGap Mobile App:
Connect
, which will download the current version of the app and launch it on the mobile device. (Note the two options listed below the Connect button which may be useful for refreshing your work)As with the desktop app, changes should automatically be pushed to your device as they are made.
Commit your work to GitHub:
Complete any unfinished work and commit it to your repo by 11:59pm Sunday, April 15th.