Join David Gassner for an in-depth discussion in this video Saving notes to persistent storage, part of Building a Note-Taking App for Android (2013).
The note taking app now has the ability to add a new note to the editor, allowing the…user to type in new information or to edit an existing note.…But in neither case is it saving changes to persistent storage.…And that's the feature that I'll add next. I'm working in a version of the project…called save note that continues from the last exercise.…The first step in saving data, is to pass data from the editor activity back to the…main activity. So, I'll go to the note editor activity…class I'll expand to full screen and I'm going to add a couple of features.…
First of all, I'm going to add a new method that I'll call, save and finish.…When you go from one activity to another activity, returning to the previous…activity is called finishing. And there's a method named finish you can…use to make that happen. But before you call that method, if you…want to pass data back, you have take a few other steps.…I'll create a new private void method, that I'll call saveAndFinish.…The first step when the user touches the back button, is to get the text that…
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