For developers, nothing is quite as helpful in the process of learning a new platform as a set of solid examples to guide you down the right path. Google hears that and has started assembling "apps-for-android," a Google Code repository that'll ultimately end up featuring a series of sample apps that exercise Android's
various capabilities. The site is a little barren at the moment with the only available sample being "WikiNotes," a rich text editor that uses Android intents to navigate to content. No doubt we'll see a whole slew of apps pop up here as time goes on, but in the meantime, wiki 'til you're blue in the face, why don't you? Follow the break for Google's WikiNotes release notes.
WikiNotes for Android is a sample application designed to be as simple as possible while still demonstrating several major concepts of the Android platform, including:
- Activities with IntentFilters for viewing, editing and searching specific MIME data types, in this case a MIME type defined for a wikinote or a list of wikinotes
- The activities themselves which demonstrate lifecycle, state management, forward navigation through intent resolution
- Use of the Linkify class to turn ordinary textual information into live links that fire default intents
- Use of default intents on different data types to achieve different results, for example, navigating to a new wiki note, or calling a phone number, or browsing to a URL, etc.
- A custom ContentProvider that looks up wiki notes using a note name, this demonstrates the pattern matching of ReST-like URIs to find the data and pass parameters like the note name to find as part of the URI.
- Within the ContentProvider implementation, SQLite usage for storage, retrieval, update, deletion and searching of data
- UI layout and creation for multiple activities, including menus
There are many more subtleties demonstrated by the application, but it is also deliberately kept limited in functionality so as not to obscure the important concepts behind a cloud of features and edge cases.