Week 10

Mobile and Chrome

Bye Bye Preload() , Hello Call back

var town;
var url;
var name;


function setup() {
  createCanvas(400, 400);
  background(200,200,100);

  
  town = createInput("london");

  name = town.value();
  url = "https://api.openweathermap.org/data/2.5/forecast?q=" + name + "&APPID=e4d37ccc2c4f3977c2e466fa78b38fcb&units=metric"

  loadJSON(url,gotData);
  
}


function gotData(data){ 
  console.log(data.list[0].main.temp);
  text(data.list[0].main.temp,100,30);
}


function draw() {
}

 

Download

3MB
Open
MOBILE

Use Chrome

Click Sensors

Click Orientation

deviceMoved()

deviceTurned()

deviceShaken()

deviceShaken()

Geo-location

Mobile phone - USB debugging

https://developers.google.com/web/tools/chrome-devtools/remote-debugging/?hl=en

Server.js - HTML - Editor - Terminal

Web Development

MEAN Stack

Assignment

10 Minute talk on your final project: can be either formal or informal

Last updated