0% found this document useful (0 votes)
41 views

Basic Android User Interface Components: 2.1. Activity

An activity represents the visual interface of an Android application and uses views and fragments to create the user interface. Fragments are optional reusable components that run within an activity and help support different device sizes. Intents allow for asynchronous messaging between application components, such as services and activities, and enable functionality from other apps via implicit intents that the system evaluates to find matching components.

Uploaded by

Abhishek Ganotra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Basic Android User Interface Components: 2.1. Activity

An activity represents the visual interface of an Android application and uses views and fragments to create the user interface. Fragments are optional reusable components that run within an activity and help support different device sizes. Intents allow for asynchronous messaging between application components, such as services and activities, and enable functionality from other apps via implicit intents that the system evaluates to find matching components.

Uploaded by

Abhishek Ganotra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

2.

Basic Android User Interface components


The following gives a short overview of the most important user interface components in Android.

2.1. Activity
An Activity represents the visual representation of an Android application. Activities use Views and Fragments to create the user interface and to interact with the user.

An Android application can have several Activities.

2.2. Fragments
Fragments are components which run in the context of an Activity. Fragment components encapsulate application code so that it is easier to reuse it and to support different sized devices.

Fragments are optional, you can use Views and ViewGroups directly in an Activity but in professional applications you always use them to allow the reuse of your user interface components on different sized devices.

3. Other Android components


Android has several more components which can be used in your Android application.

3.1. Intents
Intents are asynchronous messages which allow the application to request functionality from other components of the Android system, e.g. from Services or Activities. An application can call a component directly (explicit Intent) or ask the Android system to evaluate registered components based on the Intent data (implicit Intents ). For example the application could implement sharing of data via an Intent and all components which allow sharing of data would be available for the user to select. Applications register themselves to an Intent via an IntentFilter.

Intents allow to combine loosely coupled components to perform certain tasks.

You might also like