Android’s Application Components
Android applications are written using application components, which allows for sharing of application resources among all applications installed on an Android device. This means an application can ‘publish’ its resources, such as user interface elements, so that they can be used by other applications on the device, and vice versa. Android allows the sharing of components with other applications by automatically instantiating the Java objects responsible for the desired component. This means that applications do not need to subsume or even link to the application components they want to share — they simply ask Android to run the desired component within the application that contains it.
Since the system must be able to start an application process when any part of it is needed, and instantiate the Java objects for that part, Android applications don’t have a single entry point for everything in the application (no main() function, for example). Rather, they have essential components that the system can instantiate and run as needed.
There are four types of components: activities, services, broadcast receivers, and content providers. Activities, services, and broadcast receivers are activated through asynchronous messages, called intents. Android finds the appropriate activity, service, or set of broadcast receivers to respond to the intent, instantiating them if necessary. Content providers are activated when they are requested from a ContentResolver’s method call.
To learn more about Android development, please sign up for the webcast Getting Started Developing for the Android Platform “on April 8th.