Android App is a software designed to run on an Android device or emulator. The term also refers to an APK file which stands for Android package. This file is a Zip archive containing app code, resources, and meta information.
Android apps can be written in Kotlin, Java, and C++ and are run inside Virtual Machine. The official development environment is Android Studio.
Apps are normally distributed through app markets such as Google Play Store, so it is possible to enable installation from APK file or via USB connection in device settings.
To install or distribute APK in stores, it should have a unique package name (e.g.,
com.example.app) stored in the meta-information. After installation, this name is registered with Package Manager.
Android applications are organized as a collection of components. There are four types of components, and applications can be composed of one or more of each type. A dynamic instance of a component corresponds to an application subset that can be executed independently of the others. So, in many ways, an Android application can be thought of as a collection of interacting components. Android application components come in four flavors:
- •Activities. User-facing components that implement display and input capture.
- •Services. Background components that operate independent of any user-visible activity.
- •Broadcast receivers. A component that listens for and responds to system-wide broadcast announcements.
- •Content providers. Components that make application data accessible to external applications and system components.
We elaborate on each of these below.
Activities. An activity component implements interactions with the user. Activities are typically designed to manage a single type of user action, and multiple activities are used together to provide a complete user interaction.
For example, a mapping application may consist of two activities: one that presents to the user a list of locations to map, and one to display a map graphic that includes the chosen location. An activity includes a default window for drawing visual elements. An activity will use one or more view objects, which are organized hierarchically, to draw or capture user input. Views can be thought of as widgets, or user-interface objects, such as check boxes, images, and lists that are common to all types of GUI-based development environments. The Android SDK includes a number of views for developer use.
Services. Long-running or background components that do not directly interact with the user are expressed as service components. For example, I/O operations that are initiated by an activity may not complete before the user-facing activity disappears. In this instance, a service component can be used to carry out the I/O task, independent of the lifetime of the UI elements that initiated it. Services define and expose their own interfaces, which other components bind to in order to make use of the service. As is common with UI elements in GUI environments, services typically launch their own threads in order to allow the main application process thread to make progress and schedule threads associated with other components.
Broadcast receivers. As previously discussed, system-wide broadcast events can be generated by the system software or by applications. Components that listen to these broadcasts on behalf of applications are broadcast receivers. An application can include multiple broadcast receivers listening for announcements. In response, a broadcast receiver can initiate another component, such as an activity, to interact with the user or use the system-wide notification manager.
Content providers. Components that provide access to an application’s data are content providers. Base classes are provided in the Android SDK for both the content provider (that is, the content provider component must extend the base class) and the component seeking access. The content provider is free to store the data in whatever back-end representation it chooses, be it the file system, the SQLite service, or some application-specific representation (including those implemented via remote web services).
Android applications consist of combinations of these component type instances. The invocation of components is managed through a system-wide broadcast mechanism based on intents.