Join David Gassner for an in-depth discussion in this video Demoing the finished app, part of Building a Note-Taking App for Android (2013).
The app that I'm describing how to build in this course is named, Plain Ol' Notes. I'll show you how to build it from start to finish, and provide a completed version of the code. But if you'd simply like to load it onto an Android device, a phone or a tablet, you can get it from one of two places. It's available in the Google Play store on this page under Plain Ol' Notes, and it's also available on Amazon.com for Kindle Fire users. Again, named Plain Ol' Notes. It's free in both environments.
If instead you'd like to run through the application on an emulator, you can go to Eclipse and import the code from the exercise files. In Eclipse go to the menu and select File > Import > Existing projects into work space. Browse to choose an archive file. Go to the 01 overview folder and choose plainolnotes.zip. There are two projects in this archive: Plain Ol' Notes and action bar sherlock, an open source library that the application depends on.
I'll finish the import process, and that imports both projects. When you're working on your code and testing it, make sure you have both projects open. The Problems view will show a set of warnings. You can ignore those, they're produced by the action bar Sherlock library and don't do your application any harm. To test the application, go to the source folder and to the default package, and open up one of the classes. Then run the application on an emulator or a device. I'll run it on an emulator that's running Android 4.2.2, or Jelly Bean. The application has a very simple UI, there's a plus icon on the Action bar and when you click it, you go into an editing screen. Here you can type any note.
I'll type here's a note. And then you can either click the device's Back button, or the launcher icon which has turned into an Up button. When you return to the List screen, the note is saved persistently. I'll click Plus again, and I'll add another note. And this time I'll click the Back button. To edit an existing note, click or touch it, and then you can make changes and return to the List screen and the changes will be saved. And to delete a note, touch and hold for a moment, and you'll get a context menu, touch Delete, and the note is gone.
If you exit the application by returning to the home screen and then restart it, the notes will still be there because they're being saved to persistent storage. So I'll go to my App list and I'll load the application again, and there's my note. So that's it, a very simple application that's designed to teach you the critical parts of building a note application. Two activities, a single editing environment and saving the data persistently on the device, so that it's still available after an application restart or a device reset.
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