Page 112 - KEC Khaitan C5 Flipbook
P. 112
MAKING CLICK EVENT FOR BUTTON
To make click event for button, follow the given steps:
Step 1 Click on button Talking_Me.
Step 2 Drag and drop when Talking_Me. Click
do to workspace.
This is an Event Handler block that will handle what
happens when the button on your app is clicked.
PROGRAM THE TEXTTOSPEECH ACTION
To program the TextToSpeech action, follow the given steps:
Step 1 Click on TextToSpeech1 block.
Step 2 Click and hold the call TextToSpeech1.
Speak message block.
Step 3 Drag it over to the workspace and drop it
over the when Talking_Me.Click do block.
This block will execute when the button on our app is clicked and make our phone speak.
ENTER MESSAGE IN THE TEXT BLOCK
To enter message in the Text Block, follow the given steps:
Step 1 Click on Text component.
Step 2 Drag and drop message block on call TextToSpeech1.Speak message block.
Step 3 Type the message within the message block.
Note: By modifying this you can create a Chatbot using the similar process.
TESTING THE APP
App Inventor allows us to test our app while creating. To test your app, connect your
android device to the Internet and download MIT AI2 Companion. Then, follow the given
steps:
Step 1 Click on the Connect menu.
Step 2 Select AI Companion from the drop-down list.
110 Premium Edition-V

