As mentioned, Android runs a top a Linux kernel. Android applications are written in the Java programming language, and they run within a virtual machine (VM). It's important to note that the VM is not a JVM as you might expect, but is the Dalvik Virtual Machine, an open source technology. Each Android application runs within an instance of the Dalvik VM, which in turn resides within a Linux-kernel managed process, as shown below.
Types of Application component
There are four different types of application components. Each type serves a distinct purpose and has a distinct lifecycle. The following application components are :
- Activities : An activity represents a single screen with a user interface. An application that has a visible UI is implemented with an activity. When a user selects an application from the home screen or application launcher, an activity is started. An activity is implemented as a subclass of Activity.
- Services : A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service should be used for any application that needs to persist for a long time, such as a network monitor or update-checking application. A service is implemented as a subclass of Service.
- Content providers : A content provider manages a shared set of application data. You can think of content providers as a database server. A content provider's job is to manage access to persisted data, such as a SQLite database. If your application is very simple, you might not necessarily create a content provider. If you're building a larger application, or one that makes data available to multiple activities or applications, a content provider is the means of accessing your data.
- Broadcast receivers : A broadcast receiver is a component that responds to system-wide broadcast announcements. An Android application may be launched to process a element of data or respond to an event, such as the receipt of a text message.
Note : Content providers are also useful for reading and writing data that is private to your application and not shared.
A content provider is implemented as a subclass of ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions
A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object.