You'll have to store the data somewhere, and the most logical place is a database. For Android
apps, you can use a local SQLite
database as this is probably a non-relevant data to be stored in a central data base, so in a local database should be enough. Each time you reopen your window, simply query the last lines and place it once you open your window.
You might want to have a look here.