Theory
📱🧩 7. Show Time App
🌟 What is this app about?
- This app is like a wristwatch for your phone, letting you pick the time for a special event.
- It has a big button to set the time and a label that shows the time you picked.
- The app is super easy to use, with bold buttons and colourful labels.
⚙️Components used in this app
Time Picker
- ⏰ The Time Picker component in App Inventor is like a cool digital watch that lets you set the time for an alarm or a reminder.
- 👆 You just tap it, and it pops up with a clock where you can choose the hour and minute, just like setting the time you wake up in the morning!
- 🕒 It’s great for making apps where timing is important, like when you’re timing a race or waiting for cookies to bake.
- 🎨 You can change how the Time Picker looks so it can match your super awesome app’s style.
- 🔧 Plus, you can make it do things when the time is set, like starting a game or opening a secret message!
👩💻 Designing the App:
- 🌟 Start with a Clean Slate
- Open your project in App Inventor and you have ‘Screen1’ all ready to go.
- Make sure ‘Screen1’ is set to align everything to the centre so it looks good.
- ⏰ Add the Time Picker
- Drag the ‘Time Picker’ component onto your screen.
- Set the ‘Time Picker’s text to “Set Time” and make the font size 20 so it’s easy to tap.
- 🕒 Display Time with Labels
- Place a ‘Label’ below the Time Picker and name it ‘ShowTimeLabel’. This is where you’ll see the time you set.
- Make ‘ShowTimeLabel’ bold, size 20, and colour it blue for a bit of fun.
- Add another ‘Label’, call it ‘Time Label’, and set its colour to red. This one will be the secret spot where the chosen time will show up.
- 🛠️ Make It Work
- In the Blocks Editor, you’ll make the Time Picker pop up a clock when you tap “Set Time”.
- Then, you’ll write a little code to grab the time you pick and put it in the ‘Time Label’ so you can see it.
- 🚀 Test Your Time Machine
- Click on “Set Time”, spin the clock to the time you want, and then watch ‘Time Label’ to see the time appear!
👩💻 Coding the App:
- 🕒 When you’re done setting the time with the Time Picker (that’s like choosing the time on a clock), the app starts to think.
- 🔗 It sticks together the hour and minute you picked with a “:” in the middle, so it looks just like the time on a digital clock.
- 🕖 If the time you set is later than 9:01 PM (that’s what “Hour > 21 and Minute > 1” means), the app has a special message for you.
- 🛌 It changes the ‘Time Label’ to say “It’s time to go to bed immediately” – like a gentle nudge that bedtime is super close!
So this clever bunch of blocks is your personal bedtime reminder, telling you when i
t’s time to hit the hay! 🌙💤
🚀 What other similar apps you can create?
- 🚀 A countdown app for your own rocket launches in the backyard.
- 🎂 A birthday reminder app that tells you when it’s time to sing and cut the cake.
- 📅 A homework planner that reminds you when to start each assignment.