A quick refresher of application components under Android
The different component typesComponents come in four types:
- Activities: these are components that provide a user interface screen and correspond to activities that the user might perform, e.g. dial a phone number, take a photograph, or compose an email.
- Services: these are components that perform potentially long-running tasks that operate in the background without a user interface, e.g. downloading a file, playing music, or synchronising email with a server.
- Content Providers: these are components that provide controlled access to their app’s data. Content Providers are intended for when an app wants to share its data with other apps, e.g. a contacts app may want to share access to its database with the phone app or an email app.
AndroidManifest.xmlfile which (among other things) lists the app’s components so that Android can run them.
Note for Nerds: unlike the other types of components, Broadcast Receivers can also be registered programmatically. This is done using
registerReceiver(). A typical use for doing this would be if an app is only interested in a certain type of message when it is in a particular state. A Broadcast Receiver registered with
registerReceiver()can be unregistered with
Secure Android App Development
Our purpose is to transform access to education.
We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.
We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.