#2 App Inventor Coding the App's Behavior #2

Import Sound

STOP: Import the Beep sound (you should see it in the media files)

Kidsdata/MrsSuda/AppandGameDesign

TECHNICAL TERMS

Event

Something that happens to an app either through the action of the user (e.g., clicking a button, touching the screen, moving the phone) or through some other real world action (e.g., receiving a text message or phone call).

Event handler

A software element that responds to an event, such as the when Button.Click block in App Inventor.

Event-driven programming

Writing apps where the control of the app depends on how it responds to various events..

Event loop

Mobile devices are designed to constantly listen for events to occur and then to respond to those events.

GUI

A Graphical User Interface (GUI) is one that contains windows, buttons, and other components that the user can use to interact with an application.

Operating system

Software, such as the Android or iOS operating systems, that intermediate the interaction between mobile apps and the underlying hardware.

First: Add notifier as a non-visible component

You can use notifiers for different kinds of popups.

Task: What we're going to do now is program our button so that when it's clicked, the Notifier will pop up and display the greeting that's been typed into the text box.

Go to Blocks view

App Inventor, as we're going to learn, is what's called event-driven programming. When you click on a button, that causes an event, namely a button click. That's the event. App Inventor lets us respond to these various events, hence, it's called event-driven programming.

Blocks Summary

Brown Blocks - Event handler block that perfrom an event

Purple Blocks - procedure blocks that perform actions

Green Blocks - a bunch of blocks that can set and get properties of the component

Adding a sound component

Add a sound component

Task: Modify the code (i.e., the blocks) in the When ButtonAddMe.Click event handler so that it plays the sound in addition to showing the greeting.

Task: Test your app to make sure it works properly. (The video below will show the solution of adding the sound.)

Event Loop

The Event Loop happens each time the button is clicked. It's not a one time event, but will continue until to happen. See the pic below

Created By
Shannon Suda
Appreciate

Credits:

Created with images by Hey Paul - "Marvin" • asgw - "Android eating Apple" • manolofranco - "musician street paris"

Made with Adobe Slate

Make your words and images move.

Get Slate

Report Abuse

If you feel that this video content violates the Adobe Terms of Use, you may report this content by filling out this quick form.

To report a Copyright Violation, please follow Section 17 in the Terms of Use.