|
C O U R S E L E C T U R E Developing an Android App Notes taken on June 17, 2014 by Edward Tanguay |
four kinds of application components
enables users to give and receive
supports long-running background operations
listens for and responds to device events
stores and shares data between multiple applications
applications have any number of the above kinds of components
implemented as Java classes
primary class for user interaction
an activity should provide a single, focused thing for a user to do
a sub-class of Activity
run away from UI thread
allows music to continue playing even when you move to another app
users a service to play the music file
listens for and responds to events
events are represented by the intent class
e.g. the messaging application
someone wants to send me an SMS message
Android sits and waits for SMS messages to arrive and when one arrived, publishes an SMSmessageReceived intent
stores and shares data across applications
use database-style interface
handle interprocess communication
e.g. browser application
browser opens bookmarks in a Content
BrowserProvider extends ContentProvider
more complex application with two activities
building an application
apk is signed to identify the developer
apps are more than source code
you can easily alter these resources
in java, you refer to them as R.string.string_name
implement applicatoin classes
install and run application
you can add another language of strings by adding a directory, e.g.