Saving Data with Local Persistence

Marco L. Napoli · 2019

This chapter helps developers to learn how to persist data—that is, save data on the device's local storage directory—across app launches by using the JavaScript Object Notation (JSON) file format and saving the file to the local iOS and Android filesystem. To create reusable code to handle the database routines such as writing, reading, and serializing data, developers will place the logic in classes. To format dates, they use the intl package providing internationalization and localization. The chapter also helps developers to build a journal app that saves and reads JSON data to the local iOS NSDocumentDirectory and Android AppData filesystem. The app uses a ListView to display a list of journal entries sorted by date, and developers will create a data entry screen to enter a date, mood, and note. The entry page is responsible for adding and editing a journal entry. The Home page is responsible for showing a list of journal entries.

Read the paper · More papers on PaperTik