KS3 Computing · Real programs keep data in lists, take text apart as strings, split work into subroutines, check their input, save to files, and get tested on purpose.
Use a stand-up to say what you did, what you will do next and what is blocking you.
Use a list in App Inventor to store many items under one name.
Create the must-have features in your brief one at a time, testing after each one.
Write a short log of what you built and what comes next.
Success criteria
I can give my stand-up in under a minute.
I can add an item to a list and show the whole list on the screen.
I can show one feature from our brief working on a phone.
I can write my log at the end of the lesson.
Key words
Say each word, then read what it means. Every one is in the glossary too.
List
One name holding many values in order. Also called an array.
Index
An item's position in a list, counting from 0.
Subroutine
A named block of code you can call when needed.
Function
A subroutine that returns a value.
Parameter
A placeholder in a subroutine for a value passed in.
Validation
Checking input is reasonable before using it.
Boundary data
Test data at the very edge of what's allowed.
The explanation
Read it here, or open the study page below to go one step at a time with things to try.
The stand-up
A stand-up is a very short team meeting at the start of the lesson. Everyone stands, so it stays short.
Each person answers three questions:
What did I do last lesson?
What will I do today?
Is anything blocking me?
A blocker is a problem that stops you, like a missing picture or a bug you cannot fix.
e.g.Example
'Last lesson I built the screen. Today I will make the Add button work. Blocker: I don't know how to store more than one task.'
★Remember
One minute each. Solve problems after the stand-up, not during it.
Lists in App Inventor
A list stores many items under one name, in order. You met lists in Scratch in Year 7.
Block
What it does
initialize global tasks to (create empty list)
Makes an empty list called tasks
add items to list
Adds an item to the end of a list
select list item
Gets the item at an index, like 1
remove list item
Takes out the item at an index
length of list
Says how many items the list holds
An index is an item's place number in the list.
★Remember
App Inventor counts list items from 1, like Scratch. Python counts from 0.
A ListView component shows a whole list on the screen, one item per line.
Worked example: the homework list
The screen has a text box (txtTask), a button (btnAdd) and a ListView (lvTasks).
initialize global tasks to (create empty list)
when btnAdd.Click
add items to list list: (get global tasks) item: (txtTask.Text)
set lvTasks.Elements to (get global tasks)
set txtTask.Text to ("")
The list starts empty when the app opens.
The user types a task and presses Add.
The text in the box goes onto the end of the list.
The ListView shows the whole list again, with the new task.
The text box is cleared, ready for the next task.
e.g.Example
Stretch: add a task only if the box is not empty. Use an if with not and the is empty text block.
!Watch out
Variables vanish when the app closes. To keep the list, save it with a TinyDB component. TinyDB stores data on the phone.
Build, test, log
Pick one must-have feature from your brief.
Build only that feature.
Test it on the phone.
It works? Save a checkpoint, then pick the next feature.
At the end of the lesson, write your log.
★Remember
Projects → Checkpoint saves a copy that works. If a change breaks the app, open the checkpoint.
e.g.Example
Log: 'Lesson 4: the Add button puts tasks in the list and shows them. Problem: empty tasks were added. Fixed with an is-empty check. Next: tick tasks off.'
e.g.Worked example
The list tasks holds: 'Maths p.12', 'Science poster', 'French words'. What does select list item with index 2 give? What is the list after remove list item with index 1?
App Inventor counts from 1. Item 1 is 'Maths p.12'. Item 2 is 'Science poster'.
So index 2 gives 'Science poster'.
Removing index 1 takes out 'Maths p.12'.
The list is now 'Science poster', 'French words'. Each item moves up one place.
In Python the list starts at index 0. So index 2 would give 'French words'.