Android for mobile: app structure

Android from Google is an operating system for mobile phones. It is based on Linux. In the architecture of Android applications, concepts have emerged that go beyond traditional models.

Data presentation model

This model is used, in particular, by the Java Swing library. The view is the interface through which the user interacts with the software. The data is stored separately and can be displayed in different views.
The view can also change the data depending on the context, for example, changing the text according to the user's language.

Android model

Android extends this viewing/data model by providing a new model suitable for always-on devices. The structure of the application is defined as follows:

Views (android.view.View class)

AndroidManifest.xml file

Application components:

In addition to components, there are also resources that can be XML files, JPEG image files, and others. They use the android.content.Resources interface and are stored in the res directory.

Application components

Each component is listed in the AndroidManifest.xml manifest file of each application .


HTC Hero с Android

Activity

The action corresponds to the screen. If an application consists of multiple screens, it has activity for each screen. Each activity is a class that extends the Activity base class. It has a graphical user interface consisting of views and responds to events. When the screens change, a new action is started. This action can return a value. For example, if an action allows you to select something, text, image, it returns what it has. selected.

The graphical interface of the action is described in the format:
- Full screen.
- Floating: dialog or alert.
-nothing. At the same time, it works in the background and is invisible. It is made visible by giving it a layout.

Note that the graphical interface is described in XML as XUL and XAML.

Intention

Targets are targets of applications.ations and are implemented by changing screens. The intention is formed from the action and data, which are URIs.
Examples of actions: MAIN, VIEW, EDIT, PICK .
If we want to view a person's profile, we form an intention. The action is VIEW and the data is the URI that allows access to this profile.
IntentFilters describe how to apply an action. An IntentReceiver is an object that responds to external events. It can run internally or run an application.

For an example of intent, see the VIEW web page for activity and data https://www.iqlevsha.ru.

Service

The service is designed to run regardless of the screen, and therefore from activities. The best example is a music player that can work when switching from one screen to another.

Content provider

Data stored in SQLite files or databases is private and cannot be used by other applications.

We use a content provider to exchange this data between applications. The ContentResolver interface is an interface that provides data to other objects.

Notice

The android.app.Notification class defines how the user is notified of an event: icon display, light, vibration, or more.
While the android.app.NotificationManager class sends a message in a specific form.

Conclusion

The Android app model offers concepts beyond the mobile phone interface. It is designed for a set of applications that share data, run each other, run in the background or in on-screen view. This is an interface between the user and a robotic operating system that could run on a laptop or desktop computer.

Reference: developer.android.com

See also: Android and Nexus One.