reading_notes

Read: 26 - Android Fundamentals

Application Fundamentals

Anroid

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.

App Components

There are four different types of app components:

Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.

Activating components

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).

The manifest file

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:

Declare Components

<?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>

You must declare all app components using the following elements:


Resources:

Android fundamentals