Join David Gassner for an in-depth discussion in this video Modeling a data item with a Java class, part of Building a Note-Taking App for Android (2013).
Regardless of how you're going to store data in your Android app the first step in…creating a data persistence layer is to create a Java class that models the data…you're going to store. I'm going to be storing notes and each…note is going to have a key and a value. So, I'm going to create a Java class that…has those two properties or fields. I'm working in a version of my project…called data item. And I'll go to the source folder within…the data item project. Right now, my project only has a single…package, the application package. I'm going to create a subpackage.…
And I'm going to put all the Java classes that have to do with data management in…that package. I'll right-click on the existing package…and choose new package and I'll add a sub package of .data and click Finish.…Now I'm ready to create my Java class. I'll right-click on the package and I'll…select new class and I'll name the new class note item.…You can name this class anything you want, and you'll see a variety of different…naming conventions. You'll see some developers use a suffix of…
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