Visual Programming?

Visual Programming?
(and FRIDAY!)
App Inventor!
http://beta.appinventor.mit.edu/abo
ut/moreinfo/
Open source now!
(moved from Google to MIT)
We can already this…
The reason it is challenging (or not?!)
• In general…
– I/O is not through the keyboard
– Need to get a file and “play” the sound…
• Event driven!
– User does something
– We respond, not “sequential”!
How do we handle this?
• Make it so that there CANNOT be errors!
– No missing semi colons
– No missing parameters
– COLOURS!!!
– VISUAL!
• New constructs?!
– When/do (green)
– Call (purple)
Accessing device features…
It won’t work if it is not right!
• Can’t miss the parameter!
• Can’t give it a negative value
• Don’t need a semi-colon!
– Didn’t in coffee script?!
– Dart?!
– Another example… Magic 8 ball!
Setting up the screen…
Prediction code!
Setting variables and Making a list
• Set is blue!
• List…
– A little like an array!
– No index… or not that we see?
– Pick random!
Using the Accelerometer… Shaking!
Speak?
• Challenge 1: Make the Magic 8-Ball Speak
• Instead of (or in addition to) making the
prediction appear as text, can you make the 8Ball speak it aloud? Hint: the text-to-speech
component is under the Other Stuff palette in
the Designer. Note: Most Android devices have
the text-to-speech (TTS) capability, but if you have
trouble getting the TTS component in App
Inventor to work, you may need to find out how
to install TTS and/or enable TTS on your device.
Pong
Starting…
Game over?
Keeping score!
Adding this in…
What is this one?
Can do serious stuff!
•
•
•
•
University of San Francisco
Local database
Accessing sensors
Full emulator
The big “idea”
• To use App Inventor, you do not need to be a
professional developer. This is because instead
of writing code, you visually design the way
the app looks and use blocks to specify the
app's behavior.
Tutorials…
• No Text While Driving
This tutorial demonstrates how an app can respond to text messages
automatically. You'll build an app that sends back a response when a text
message is received. The idea for the app came from University of San
Franciso student Daniel Finnegan.
• No Text While Driving, Part 2
You know that texting while driving is dangerous, so you've created and
installed the No Text While Driving app on your phone. Now, when you
drive you open that app and let it auto-respond to incoming texts. But the
jingle of the texts coming in is killing you with curiosity-- wouldn't it be
great if you could hear the texts spoken aloud? With Part II of the tutorial,
you'll extend the app so that it speaks out both the message and who sent
it. And since you're making some changes anyway, you'll modify the autoresponse so it reports your whereabouts in the reply: "Sorry, I'm driving
and I'm at 1600 Pennsylvania Avenue". Before completing this tutorial you
should complete part I.
More Tutorials…
• Broadcast Hub
In this tutorial, you'll write an app that
automatically responds to texts messages and
broadcasts texts messages it receives to a list of
phone numbers.The app is inspired by
FrontLineSMS, a tool that has been used in
developing countries to monitor elections,
broadcast weather changes, and in general
connect people that don't have access to the web
but do have phones and mobile connectivity.
More Tutorials…
• Stock Quotes
This tutorial demonstrates how to use the
Web component to make an app call a web
service (Yahoo! Finance) with a simple
application programmer interface (API).
No text while driving…
Design…
Two QUESTIONS FOR YOU!!!
• Pros/cons of visual programming?
– Find someone who is NOT in your group! 
• Do you think there is a future to this?
• How does it stack up against HTML/CSS/JavaScript?
• Rubric for marking your projects!
– Find someone ELSE who is NOT in your group!
• 90second presentation THIS Friday, demo Monday!
• Design, video, things that are missing…
– Implementation! HTML, CSS, JavaScript