Join David Gassner for an in-depth discussion in this video Creating a data source class, part of Building a Note-Taking App for Android (2013).
After you've created the Java class to model a single instance of a note.…The next step is to create a Java class that will manage all of the data.…And this is typically called a data source class.…I'm working in a version of the project called data source.…And I'll go to my data package that I previously created, and I'll create…another new class. I'll call this one notes data source.…And as I did with the note item class, I'll make this a POJO, by extending the…super class, java dot blank dot object. I'll click Finish to generate the class.…
This class is going to hide all of the functionality that's used to put, get and…remove data items from the shared preferences data storage.…And it's going to expose that functionality through a set of methods.…The first method is going to be called find all.…And it's going to return a list of notes. I'll place the cursor within the class…decoration, and I'll create a new method. It'll be public.…And it's going to return an instance of something called a list.…
In Java, the list is an interface. I'm going to be saying that I'm returning…
Like its companions, this course will take you through building a complete mobile app from scratch; but this installment uses the Android SDK and Java to get the job done. Author David Gassner shows you how to install the SDK and the Android Developer Toolkit, create a project, save data on a device, build and control screen layouts, and create action bars and icons that control navigation.
These three related courses will use the same assets to develop the same app. (See Building a Note-Taking App for iOS and Building a Note-Taking App for Windows Phone 8 and Windows Store for more information.) Compare and contrast the different steps and discover the similarities and differences!
- Previewing the note-taking app
- Creating virtual devices for testing
- Unique concepts in Android
- Creating the Eclipse project
- Using local data storage
- Adding and retrieving data with the Shared Preferences API
- Creating screen designs
- Creating and editing notes
- Supporting older versions of Android with ActionBarSherlock