Join David Gassner for an in-depth discussion in this video Adding CRUD methods to the content provider, part of Building a Note-Taking App for Android.
- View Offline
- My next step in implementing my content provider class…is to add code to all the methods that I implemented before.…I need code for the Query method to get data…back from the database., and for the Insert,…Delete, and Update methods to modify the data.…I'll start with the Query method.…The Query method will get data…from the database table notes.…It'll either retrieve all the notes or just a single row.…But, I need to say exactly which columns I want to retrieve.…
I'll define the column list in my OpenHelper class:…DBOpenHelper.…So, I'll add code right after…the existing static declarations.…I'll create a new public static final variable…and this will be an array of strings,…and I'll name it All_Columns.…And, this will be a comma delimited list…of the columns wrapped in braces.…Note_Id, Note_Text,…and Note_Created.…
I've made this constant public so it can be…referenced from anywhere in the app.…Now, I'll go back to the NotesProvider.…Each of these methods is going to use the database object…that I previously declared.…
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