Android apps can be written using Kotlin, Java, and C++ languages. The Android SDK tools compile your code along with any data and resource files into an APK or an Android App Bundle.
An Android package, which is an archive file with an .apk suffix, contains the contents of an Android app that are required at runtime and it is the file that Android-powered devices use to install the app.
The Android operating system is a multi-user Linux system in which each app is a different user.
There are four different types of app components:
Activities: entry point for interacting with the user. It represents a single screen with a user interface activity facilitate:
Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.
Three of the four component types—activities, services, and broadcast receivers—are activated by an asynchronous message called an intent. Intents bind individual components to each other at runtime.
An intent is created with an Intent object, which defines a message to activate either a specific component (explicit intent) or a specific type of component (implicit intent).
AndroidManifest.xml
app must declare all components in this file, which must be at the root of the app project directory
The manifest does a number of things in addition to declaring the app’s components, such as the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:icon="@drawable/app_icon.png" ... >
<activity android:name="com.example.project.ExampleActivity"
android:label="@string/example_label" ... >
</activity>
...
</application>
</manifest>
In the <application>
element, the android:icon attribute points to resources for an icon that identifies the app.
In the <activity
> element, the android:name attribute specifies the fully qualified class name of the Activity subclass and the android:label attribute specifies a string to use as the user-visible label for the activity.
You must declare all app components using the following elements:
<activity>
elements for activities.<service>
elements for services.<receiver>
elements for broadcast receivers.<provider>
elements for content providers.