Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.
Before you keep reading...
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.
9.6. Persisting Photos Tutorial and Projects (Optional)¶
This lesson introduces the concept of persistent storage in apps by adding a way to save pictures in the Paint Pot app. It reinforces the enduring understanding that there are trade-offs in representing digital data, in this case, the differences between storing data in memory (variables) versus persistently (TinyDB).
The Student Lesson: Complete the activities for Mobile CSP Lesson 9.6: Persisting Photos Tutorial.
Android devices or emulator
9.6.1. Learning Activities¶
Estimated Length: 90 minutes
- Hook/Motivation (5 minutes): Remind students of the use of variables and properties in the Paint Pot app. Ask them what the value of the variable is each time the app is re-started or the properties of the UI components. Explanation: Each time the app is started, the variables and properties are set to their initial values the programmer set up in the app. Right now, it does not remember information from the last time the app was used. In this lesson, we will learn how to make data persist, or last, when an app is closed and restarted.
- Experiences and Exploration (30 minutes):
- Presentation (5 minutes): Give students an overview of the TinyDb component using the video or slides.
- Tutorial Walkthrough (10 minutes): Lead students through incorporating the TinyDb component into the Paint Pot app so that it will save the background image information for the next time the app is used.
- Creative Mini Projects (15 minutes): Working in pairs, students should attempt the mini projects incorporating lists of the images taken and adding a ListPicker.
- Rethink, Reflect, and Revise (10 minutes): Review the concept of persistent data and the TinyDB component. How did it and the creative projects enhance the usability of the app by storing data? Students should complete the interactive exercises and portfolio reflection questions.
The College Board's AP Classroom provides a question bank and Topic Questions. You may create a formative assessment quiz in AP Classroom, assign the quiz (a set of questions), and then review the results in class to identify and address any student misunderstandings.The following are suggested topic questions that you could assign once students have completed this lesson.
Suggested Topic Questions:
Differentiation: More Practice
Background Knowledge: TinyDB
9.6.2. Professional Development Reflection¶
Discuss the following questions with other teachers in your professional development program.
- How does this lesson reinforce the computational thinking practice of analyzing problems and artifacts? [P 4]