Join David Gassner for an in-depth discussion in this video Retrieving data from the main activity with CursorLoader, part of Building a Note-Taking App for Android.
- View Offline
- So far my app is successfully saving data…in the local database, and then retrieving…and presenting it in the list view.…But right now, all of my database operations…are being managed on the UI thread,…the main thread.…With a small local database like this…that's not practically speaking a problem…but it is a best practice…to execute all database operations…on background threads.…There are a couple of ways of doing this.…You could create your own implementation…of async task and call all of your database operations…within that implementation,…but that would create a lot of work…managing things like orientation changes.…
When the user changes the orientation of the device,…from portrait to landscape and back again,…and you can make this happen in the Emulator,…by pressing control F11.…Each time you do that,…you would have to react to that event…and recall all of your code.…But a better way is to use the Loader interface.…Loaders execute data operations…on the background threads automatically.…And they elegantly handle changes in configuration…
Building a Note-Taking App for iOS 8 and Building a Note-Taking App for Windows Phone 8 and Windows Store use the same assets to develop a similar app. Compare and contrast the steps and discover the similarities and differences between the three platforms.
- Understanding Android UI and data management patterns
- Creating an Android Studio project
- Customizing material design theme colors
- Defining an SQLite database structure
- Managing data with ContentProvider and Loader classes
- Retrieving and displaying data
- Customizing data display with a CursorAdapter
- Creating, updating, and deleting notes
- Preparing the app for deployment