MIT APP INVENTOR
Lesson 1
2
What does
“Artificial Intelligence”
make you think of?
3
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
Artificial Intelligence (AI)
a program made by people that
makes computers do things that
seem intelligent (or smart) in the
same way that humans are
intelligent
dayofai.org | 6
Toy Pet Self-Driving Car
Examples of AI
7
The Big Ideas of AI
8
AI or Not??
9
Key Questions to Determine “AI or Not”?
1. Does it perceive its environment?
2. Can it learn over time?
3. Does it make plans on its own?
4. Does it interact with the environment?
5. Is it intelligent or is it following its programming?
10
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Toaster
Toaster
11
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Robot Dog
Video of robot dog in actio
n
12
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Automatic Door
13
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Car
14
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Face Filter
15
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Robot with Remote
16
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming?
Virtual Assistant
17
AI or Not?
1. Does it perceive its
environment?
2. Can it learn over time?
3. Does it make plans on its
own?
4. Does it interact with the
environment?
5. Is it intelligent or is it
following its programming? Self-Driving Car
18
Lesson 2: How Do
Machines Gain Intelligence?
19
Parts of machine learning
20
Datasets
A dataset is a collection of
curated data
● Images
● Measurements (time, views,
inches, etc)
● Text
● Video recordings!
21
Quick, Draw!
Quick, Draw! by Google Quick, Draw! The Data
22
Lesson 3
23
Why Learn App Inventor?
●Software is in every walk of life. Programming is becoming part of many jobs.
●Explore mobile computing
●Practical Skills -- web, math, media
● Prep for learning Java, Python, Javascript, etc.
●Creativity, entrepreneurship, idea formulation
●Problem-Solving skills
● YOU CAN CHANGE THE WORLD
This is an App Inventor app. Can you tell what it does?
No Texting While Driving
USF English Major Daniel
Finnegan created the app
in a beginning course.
"Software, after all, affects almost everything we do. Pick any major problem—global
warming, health care, or, in Finnegan’s case, highway safety—and clever software is part of
the solution. Yet only a tiny chunk of people ever consider learning to write code, which
means we’re not tapping the creativity of a big chunk of society."
Clive Thompson, Wired
Could you make the app send a particular response to a
particular number (e.g., your significant other)?
How about an app to vote by text?
Games
Text Processing Apps
Location Aware Apps Web Enabled Apps
Quizzes
Broadcast Hubs
Android, Where's my car?
What can you build with App Inventor?
Android Application Select the Designer view.
Components
Two types of components:
Visible components for creating the application user
interface (the visible look on the device screen),
Non-visible components for using the functions of the
Android devices behind the screen, e.g. phone vibration.
In a new project, a Screen component named Screen1 has
already been added by default to the create the screen of the
user interface.
chatbots using AI made by kids of all ages
Adding Component & Button Component
Palette » User Interface lists the user interface components The Screen
component is in this type but is not listed. Adding Screen components (other than
the default Screen1) will not be taught in this workshop.
Drag the Button from Palette » User Interface to anywhere on Screen1 in the
Viewer. The button is automatically positioned on Screen1 (explained later).
Parent - Child Relationship
As an example, since SpeakButton is placed on Screen1,
Screen1 is called the container or parent of SpeakButton.
SpeakButton is called the child of Screen1.
Not every kind of components can be a container.
Component List
The button is named Button1 by default.
The default name is the component type followed by an integer. The
integer increments as more components of this type is added.
Any component, except Screen1, can be renamed or deleted using
the button Rename or Delete in the Components list, respectively.
Rename Button1 to SpeakButton.
Component Property
The characteristics of a component
(e.g. its position on the parent) are
modified using the component’s
properties.
All the visible and non-visible
components could have properties.
Select SpeakButton in the Components
list and then change its Text property to
“Speak it”.
Screen Properties
The documentation of the components:
http://ai2.appinventor.mit.edu/reference/component
s
Read it now to be familiar with the properties of the
Screen component (under the User Interface
component type), and try out the properties if
desired.
For Screen1, change:
● AboutScreen to “Main screen”.
● AppName to “Hello World”.
● Title to “Hello World”.
Button Properties
For SpeakButton, try the different settings
of its Width and Height to see how its size
changes in the Viewer.
The Automatic setting is for automatic
sizing so that the button will just be big
enough to display its text or image
Finally, reset both properties to Automatic.
Label Component
The Label component is used to display text only (no user
editing is possible).
In Palette » User Interface, drag Label to Screen1 but do not
drop it yet Try dragging the label above or below
SpeakButton to see the change of the blue-line hint.
Drop the label just below SpeakButton now.
The components added to the Screen container are
always positioned vertically (one below another).
The Text property of Label1 is the text in display.
Change it to “HellonWorld”: n is a new-line character to
insert a new line.
In the Viewer, the label’s text is still
that single line in the Text property,
but it will be in two lines on the
device screen as expected (you
will see later).
Read the documentation now to be familiar with the
properties of the Label component.
Non-visible TextToSpeech Component
In Palette » Media, drag a TextToSpeech
component to Screen1.
TextToSpeech is a non-visible component,
which is also listed in the bottom of the
Viewer.
TextToSpeech is for using the text-to-speech function of the Android device,
which speaks out the English text given by your application.
Its Country and Language properties change the pronunciation and accent
not the language of the speaking, which is always in English.
Introduction to Code Blocks
Select the Blocks view in the App Inventor.
In case of using multiple Screen components, each one of
them has its own code, which is created in its Viewer and can
use only its contained components.
Four types of the code blocks of a component:
Event Handler
An event handler will execute the codes placed in the do part
(or socket) of its block when a certain event occurs in the
component.
The event is specified in the when part of the handler.
Select the component SpeakButton in the HelloWorld
project now, and then select the handler for the event
SpeakButton.Click (or drag it to the Viewer).
chatbots using AI made by kids of all ages
The event SpeakButton.Click occurs when the button
SpeakButton on the device screen is clicked (or tapped).
The events are covered in the documentation:
http://ai2.appinventor.mit.edu/reference/components
Note: all the codes of an event handler are completely executed
before another event handler can be executed. For example, after
clicking a button, during the time of this event’s handler execution,
clicking the button again (or another kind of event occurs) will not
execute the handler of this event until the previous handler
execution finishes.
EVENT HANDLER PARAMETER
An event handler can have zero or more preset values
(referred as parameters) shown on its block. For example,
the following event handler has a single parameter called
choice:
A handler parameter has already been set to a certain value
when the event occurs.
Only the codes in the do socket of the handler can use the
parameter value or reset it to another value by using the
parameter's getter block or setter block.
Code Deletion
To delete a code block in the Viewer,
drag it to the trashcan in the Viewer, or
select it and then press the Delete key
(any blocks attached to its sockets will
also be deleted).
The App Inventor does not have a
command Undo or the like for undoing
your work. Be careful of your deletion!
DEBUGGING
A block has a red triangle icon if it
has an error or a yellow triangle icon
if it has a warning (after clicking the
button “Show Warning”).
Clicking the icon shows the warning
or error message. Debug all the
warnings and errors!
Method Call
A method call calls (or executes) a certain
method of the component. A method does a
certain function of the component.
The method name is specified in the call part of
the code block.
Drag the TextToSpeech1’s call
TextToSpeech1.Speak block to the do socket
of the SpeakButton.Click event handler.
The method call of TextToSpeech1.Speak speaks out
the text (also in code-block format) attached in the
message socket of the call block:
message is called a parameter of the method.
A method can have zero or more parameters.
A call of the method may do its function differently
depending on the values (the attached blocks) of its
parameters, e.g. different calls of the Speak method may
speak different message text.
Property Getter and Setter
A property getter gets the
value of a certain property
of the component.
The property name is
specified after the
component name and a dot
in the code block.
Drag the getter block
Label1.Text to the
message socket of the
TextToSpeech1.Speak
method call.
A property setter sets the value of a
certain property of the component.
The property name is specified after
the component name and a dot in
the code block.
Drag the setter block set
SpeakButton.Text to the do socket
of the event handler but place it just
below the TextToSpeech1.Speak
method call.
PROPERTY SETTER
Built-In Text Code Block
Blocks » Built-in » Text lists the code
blocks for doing operations on text.
Drag the first code block “ ” to the to
socket of the SpeakButton.Text
setter.
This block lets you create text.
Click the part “ ” to place the cursor
inside it, and then enter the text
Speak again.
The documentation of the Built-in code blocks is in
http://appinventor.mit.edu/explore/ai2/support/blocks.html
WAYS OF APPLICATION TESTING
You can test your application in a real Android device or a
phone emulator. The details are in
http://appinventor.mit.edu/explore/ai2/setup.html
The application running in the device or emulator reflects any
application changes immediately while you are editing the
application in the App Inventor.
Using Emulator
EMULATOR STARTUP STEPS
To start the emulator, run the program aiStarter in your
computer's operating system (e.g. in All Programs » MIT App
Inventor Tools in Windows' Start menu). The startup steps
below for Windows are similar to those of other operating
systems.
A command-line window is first opened (enter Ctrl-C to close
it after the emulator is closed later).
chatbots using AI made by kids of all ages
Then click the menu command Connect » Emulator in the App Inventor.
EMULATOR UPDATING STEPS
Then, if the emulator (called the Companion App) has a new
version update, the following message or the like may appear
to ask you to update it.
Click the OK button to start the update.
Then, follow the instruction on the next message like the one
below.
Click the Got It button to close the message after reading it.
Click the OK and Install buttons on the following left and right screens of the emulator in order.
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
APP 2
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages
chatbots using AI made by kids of all ages

More Related Content

PDF
App Inventor : Getting Started Guide
PPTX
mobile Developmentmobile Developmen.pptx
PPTX
Mobile_Application_Development_for_grade 6.pptx
PPTX
App inventor week4(technovation)
PPTX
JY Pathways: Program Android Apps with MIT App Inventor 2
PPTX
Google App Inventor
PDF
Talk tomepart1
PDF
Talk tomepart1 2perpage
App Inventor : Getting Started Guide
mobile Developmentmobile Developmen.pptx
Mobile_Application_Development_for_grade 6.pptx
App inventor week4(technovation)
JY Pathways: Program Android Apps with MIT App Inventor 2
Google App Inventor
Talk tomepart1
Talk tomepart1 2perpage

Similar to chatbots using AI made by kids of all ages (20)

PPTX
Lecture 1 rapid android development
PDF
Appy builder beginner tutorial
PPT
techtalk2.23.11.ppt.ppt
PPT
Synapseindia android app sharing app inventor for android
PPTX
Google app inventor
PDF
W make104
PPTX
App inventor presentation
PDF
The Hello It_s Me Teacher Presentation.pdf
PPTX
App inventor
PDF
Jayakumar m. arduino and android using mit app inventor 2.0
PPTX
Android Basics
PPTX
Android Study Jams - Session 1
PPTX
App inventor projects
PPTX
Course Tech 2013, Abigail Bornstein,Using Adroid App Inventor to Introduce Ap...
PDF
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13
PDF
Android Development Tutorial
PPTX
PDF
Girls Can Code Mobile App Day 1
PDF
Talk tomepart2
PDF
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
Lecture 1 rapid android development
Appy builder beginner tutorial
techtalk2.23.11.ppt.ppt
Synapseindia android app sharing app inventor for android
Google app inventor
W make104
App inventor presentation
The Hello It_s Me Teacher Presentation.pdf
App inventor
Jayakumar m. arduino and android using mit app inventor 2.0
Android Basics
Android Study Jams - Session 1
App inventor projects
Course Tech 2013, Abigail Bornstein,Using Adroid App Inventor to Introduce Ap...
Notes from Educator Pre-training Briefing 1 - Summary of AfG-toolset 2012-13
Android Development Tutorial
Girls Can Code Mobile App Day 1
Talk tomepart2
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
Ad

More from Rashi Agarwal (7)

PPTX
TinyML & EDGE AI explained easily for kids
PPTX
regression.pptx
PPTX
Apriori Algorithm.pptx
PDF
PDF
Hadoop installation
PDF
Cs4hs2008 track a-programming
PDF
Makinggames
TinyML & EDGE AI explained easily for kids
regression.pptx
Apriori Algorithm.pptx
Hadoop installation
Cs4hs2008 track a-programming
Makinggames
Ad

Recently uploaded (20)

PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Complications of Minimal Access-Surgery.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
HVAC Specification 2024 according to central public works department
PDF
IGGE1 Understanding the Self1234567891011
PDF
Trump Administration's workforce development strategy
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Empowerment Technology for Senior High School Guide
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
Virtual and Augmented Reality in Current Scenario
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Introduction to pro and eukaryotes and differences.pptx
Complications of Minimal Access-Surgery.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
HVAC Specification 2024 according to central public works department
IGGE1 Understanding the Self1234567891011
Trump Administration's workforce development strategy
Cambridge-Practice-Tests-for-IELTS-12.docx
Empowerment Technology for Senior High School Guide
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
History, Philosophy and sociology of education (1).pptx
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Virtual and Augmented Reality in Current Scenario
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
LDMMIA Reiki Yoga Finals Review Spring Summer
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper

chatbots using AI made by kids of all ages

  • 6. Artificial Intelligence (AI) a program made by people that makes computers do things that seem intelligent (or smart) in the same way that humans are intelligent dayofai.org | 6
  • 7. Toy Pet Self-Driving Car Examples of AI 7
  • 8. The Big Ideas of AI 8
  • 10. Key Questions to Determine “AI or Not”? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? 10
  • 11. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Toaster Toaster 11
  • 12. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Robot Dog Video of robot dog in actio n 12
  • 13. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Automatic Door 13
  • 14. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Car 14
  • 15. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Face Filter 15
  • 16. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Robot with Remote 16
  • 17. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Virtual Assistant 17
  • 18. AI or Not? 1. Does it perceive its environment? 2. Can it learn over time? 3. Does it make plans on its own? 4. Does it interact with the environment? 5. Is it intelligent or is it following its programming? Self-Driving Car 18
  • 19. Lesson 2: How Do Machines Gain Intelligence? 19
  • 20. Parts of machine learning 20
  • 21. Datasets A dataset is a collection of curated data ● Images ● Measurements (time, views, inches, etc) ● Text ● Video recordings! 21
  • 22. Quick, Draw! Quick, Draw! by Google Quick, Draw! The Data 22
  • 24. Why Learn App Inventor? ●Software is in every walk of life. Programming is becoming part of many jobs. ●Explore mobile computing ●Practical Skills -- web, math, media ● Prep for learning Java, Python, Javascript, etc. ●Creativity, entrepreneurship, idea formulation ●Problem-Solving skills ● YOU CAN CHANGE THE WORLD
  • 25. This is an App Inventor app. Can you tell what it does?
  • 26. No Texting While Driving USF English Major Daniel Finnegan created the app in a beginning course. "Software, after all, affects almost everything we do. Pick any major problem—global warming, health care, or, in Finnegan’s case, highway safety—and clever software is part of the solution. Yet only a tiny chunk of people ever consider learning to write code, which means we’re not tapping the creativity of a big chunk of society." Clive Thompson, Wired
  • 27. Could you make the app send a particular response to a particular number (e.g., your significant other)? How about an app to vote by text?
  • 28. Games Text Processing Apps Location Aware Apps Web Enabled Apps Quizzes Broadcast Hubs Android, Where's my car? What can you build with App Inventor?
  • 29. Android Application Select the Designer view.
  • 30. Components Two types of components: Visible components for creating the application user interface (the visible look on the device screen), Non-visible components for using the functions of the Android devices behind the screen, e.g. phone vibration. In a new project, a Screen component named Screen1 has already been added by default to the create the screen of the user interface.
  • 32. Adding Component & Button Component Palette » User Interface lists the user interface components The Screen component is in this type but is not listed. Adding Screen components (other than the default Screen1) will not be taught in this workshop. Drag the Button from Palette » User Interface to anywhere on Screen1 in the Viewer. The button is automatically positioned on Screen1 (explained later).
  • 33. Parent - Child Relationship As an example, since SpeakButton is placed on Screen1, Screen1 is called the container or parent of SpeakButton. SpeakButton is called the child of Screen1. Not every kind of components can be a container.
  • 34. Component List The button is named Button1 by default. The default name is the component type followed by an integer. The integer increments as more components of this type is added. Any component, except Screen1, can be renamed or deleted using the button Rename or Delete in the Components list, respectively. Rename Button1 to SpeakButton.
  • 35. Component Property The characteristics of a component (e.g. its position on the parent) are modified using the component’s properties. All the visible and non-visible components could have properties. Select SpeakButton in the Components list and then change its Text property to “Speak it”.
  • 36. Screen Properties The documentation of the components: http://ai2.appinventor.mit.edu/reference/component s Read it now to be familiar with the properties of the Screen component (under the User Interface component type), and try out the properties if desired. For Screen1, change: ● AboutScreen to “Main screen”. ● AppName to “Hello World”. ● Title to “Hello World”.
  • 37. Button Properties For SpeakButton, try the different settings of its Width and Height to see how its size changes in the Viewer. The Automatic setting is for automatic sizing so that the button will just be big enough to display its text or image Finally, reset both properties to Automatic.
  • 38. Label Component The Label component is used to display text only (no user editing is possible). In Palette » User Interface, drag Label to Screen1 but do not drop it yet Try dragging the label above or below SpeakButton to see the change of the blue-line hint. Drop the label just below SpeakButton now.
  • 39. The components added to the Screen container are always positioned vertically (one below another). The Text property of Label1 is the text in display. Change it to “HellonWorld”: n is a new-line character to insert a new line.
  • 40. In the Viewer, the label’s text is still that single line in the Text property, but it will be in two lines on the device screen as expected (you will see later). Read the documentation now to be familiar with the properties of the Label component.
  • 41. Non-visible TextToSpeech Component In Palette » Media, drag a TextToSpeech component to Screen1. TextToSpeech is a non-visible component, which is also listed in the bottom of the Viewer. TextToSpeech is for using the text-to-speech function of the Android device, which speaks out the English text given by your application. Its Country and Language properties change the pronunciation and accent not the language of the speaking, which is always in English.
  • 42. Introduction to Code Blocks Select the Blocks view in the App Inventor.
  • 43. In case of using multiple Screen components, each one of them has its own code, which is created in its Viewer and can use only its contained components.
  • 44. Four types of the code blocks of a component:
  • 45. Event Handler An event handler will execute the codes placed in the do part (or socket) of its block when a certain event occurs in the component. The event is specified in the when part of the handler. Select the component SpeakButton in the HelloWorld project now, and then select the handler for the event SpeakButton.Click (or drag it to the Viewer).
  • 47. The event SpeakButton.Click occurs when the button SpeakButton on the device screen is clicked (or tapped). The events are covered in the documentation: http://ai2.appinventor.mit.edu/reference/components Note: all the codes of an event handler are completely executed before another event handler can be executed. For example, after clicking a button, during the time of this event’s handler execution, clicking the button again (or another kind of event occurs) will not execute the handler of this event until the previous handler execution finishes.
  • 48. EVENT HANDLER PARAMETER An event handler can have zero or more preset values (referred as parameters) shown on its block. For example, the following event handler has a single parameter called choice:
  • 49. A handler parameter has already been set to a certain value when the event occurs. Only the codes in the do socket of the handler can use the parameter value or reset it to another value by using the parameter's getter block or setter block.
  • 50. Code Deletion To delete a code block in the Viewer, drag it to the trashcan in the Viewer, or select it and then press the Delete key (any blocks attached to its sockets will also be deleted). The App Inventor does not have a command Undo or the like for undoing your work. Be careful of your deletion!
  • 51. DEBUGGING A block has a red triangle icon if it has an error or a yellow triangle icon if it has a warning (after clicking the button “Show Warning”). Clicking the icon shows the warning or error message. Debug all the warnings and errors!
  • 52. Method Call A method call calls (or executes) a certain method of the component. A method does a certain function of the component. The method name is specified in the call part of the code block. Drag the TextToSpeech1’s call TextToSpeech1.Speak block to the do socket of the SpeakButton.Click event handler.
  • 53. The method call of TextToSpeech1.Speak speaks out the text (also in code-block format) attached in the message socket of the call block: message is called a parameter of the method. A method can have zero or more parameters. A call of the method may do its function differently depending on the values (the attached blocks) of its parameters, e.g. different calls of the Speak method may speak different message text.
  • 54. Property Getter and Setter A property getter gets the value of a certain property of the component. The property name is specified after the component name and a dot in the code block. Drag the getter block Label1.Text to the message socket of the TextToSpeech1.Speak method call.
  • 55. A property setter sets the value of a certain property of the component. The property name is specified after the component name and a dot in the code block. Drag the setter block set SpeakButton.Text to the do socket of the event handler but place it just below the TextToSpeech1.Speak method call. PROPERTY SETTER
  • 56. Built-In Text Code Block Blocks » Built-in » Text lists the code blocks for doing operations on text. Drag the first code block “ ” to the to socket of the SpeakButton.Text setter. This block lets you create text. Click the part “ ” to place the cursor inside it, and then enter the text Speak again. The documentation of the Built-in code blocks is in http://appinventor.mit.edu/explore/ai2/support/blocks.html
  • 57. WAYS OF APPLICATION TESTING You can test your application in a real Android device or a phone emulator. The details are in http://appinventor.mit.edu/explore/ai2/setup.html The application running in the device or emulator reflects any application changes immediately while you are editing the application in the App Inventor.
  • 58. Using Emulator EMULATOR STARTUP STEPS To start the emulator, run the program aiStarter in your computer's operating system (e.g. in All Programs » MIT App Inventor Tools in Windows' Start menu). The startup steps below for Windows are similar to those of other operating systems. A command-line window is first opened (enter Ctrl-C to close it after the emulator is closed later).
  • 60. Then click the menu command Connect » Emulator in the App Inventor.
  • 61. EMULATOR UPDATING STEPS Then, if the emulator (called the Companion App) has a new version update, the following message or the like may appear to ask you to update it. Click the OK button to start the update. Then, follow the instruction on the next message like the one below.
  • 62. Click the Got It button to close the message after reading it. Click the OK and Install buttons on the following left and right screens of the emulator in order.
  • 69. APP 2

Editor's Notes

  • #25: Ask students to discuss this with those next to them. The app auto-responds to texts and speaks them aloud. Mention what a textbox is and the fact that the auto-response can be customized by user.
  • #26: I love Thompson's quote and usually read it aloud.
  • #27: Mention "if" and how it can be used to add artificial intelligence (logic) to any degree of complexity. Make connection to voting on tv shows like dancing with the stars.