Practice and reinforce the concepts from Lesson 10
:alarm_clock: Time needed: 30-35 minutes
Create a fun talking parrot app where Miss Parrot responds to your touch, reads your messages, and even complains when you shake your phone! You'll use text-to-speech technology to bring Miss Parrot to life with her own sassy personality! :emoji:
:emoji: Please watch this video to see how Miss Parrot works:
:emoji: The sample UI of the app:
Time to make Miss Parrot come alive! She's a chatty bird who loves to talk back, read your messages, and has opinions about everything!
:bulb: "Finding Images"
Look for a colorful parrot image! You can search for "cartoon parrot" in Google Images. Make sure to choose one that's not too big (under 1MB works best).
Add these components to your app:
Image component - This will be Miss Parrot!
TextBox component - Where users type messages
Button component - To make Miss Parrot talk
From the palette, add:
:bulb: "Can't Find Components?"
Use the search box at the top of the Palette! Just type "TextToSpeech" or "Accelerometer" and they'll appear!
Now for the fun part - making Miss Parrot talk! Here's what to program:
When someone clicks the button but hasn't typed anything, Miss Parrot gets sassy!
Create a list of funny responses like:
When there IS text in the textbox, Miss Parrot reads it out loud!
When someone presses and holds on Miss Parrot's image:
Create another list of responses like:
When someone shakes their phone:
Make Miss Parrot say things like:
Here's how to code each feature:
:bulb: "Stuck on Random Responses?"
- Create a list variable called "emptyResponses"
- Add all your funny responses to the list
- Use the "pick random item from list" block to choose one
- Have TextToSpeech speak the random response!
For the Button Click:
For Long Press:
For Shake Detection:
Once your basic app is working, try these challenges:
Can you change Miss Parrot's voice? Try adjusting:
Give Miss Parrot different moods!
Make Miss Parrot remember things!
Add animations or changes:
Before submitting, make sure to test:
:white_check_mark: Button Test:
:white_check_mark: Touch Test:
:white_check_mark: Shake Test:
:white_check_mark: Voice Test:
:bulb: "Testing on Computer?"
The shake feature only works on real phones! Use the MIT AI2 Companion app to test on your device.
Make sure your app includes all these components:
:white_check_mark: Image (Miss Parrot) :white_check_mark: TextBox (for user input) :white_check_mark: Button (to trigger speech) :white_check_mark: Labels (optional - for decoration)
:white_check_mark: TextToSpeech :white_check_mark: AccelerometerSensor
:white_check_mark: If-then-else for empty textbox checking :white_check_mark: Lists for storing responses :white_check_mark: Random selection from lists :white_check_mark: Event handlers for:
Great job creating Miss Parrot! She's ready to chat, complain, and entertain!
Submit Your Miss Parrot App Here
⭐ Personality - Your parrot has a unique, fun character ⭐ Variety - Multiple different responses for each interaction ⭐ Creativity - Funny, surprising, or clever responses ⭐ Polish - Nice design and smooth interactions ⭐ Bug-free - Everything works without crashing
Keep making awesome apps! Miss Parrot is proud of you! :emoji::sparkles: