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).

Professional Development

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.

AP Classroom

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:

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]