Application Basics
Android applications are written in the Java programming language.
The android SDK tool compiles Android code, data, and resource files into an android package. This is a collection file with the name ending with .apk. The code in the same APK file is considered an application.
After an android application is installed on a device, each android application resides in its own security sandbox.
The Android operating system is a multi-user Linux system, and each application is equivalent to a user.
By default, the system assigns an independent Linux User ID to each application. the system grants a license to all the files of the application, so that only the user (actually a process) corresponding to the application can access the application.
Each process has its own Virtual Machine (VM), which ensures that one application code is isolated from other applications.
By default, each application has its own Linux Process after it runs.
The Android system implements the minimum permission principle. By default, each application only has the permission to access its own components (to ensure that it works properly ).
There are two ways for an application to share data with other applications:
1. Share the same Linux User ID with two applications;
2. the user authorizes the application (during installation)
Common android classes
1. Activity
Activity is an application part. It provides the visible part of the screen for user interaction.
Android applications can activate an activity of another application. In this regard, Android applications do not have a main entry function like Java or C.
The activities developed by developers are subclasses of Android. App. activity.
2. Intent
Data transmission between applications is similar to a submitted form.
3. Service
Invisible. It undertakes most of the data processing work.
The service runs in the background and performs a long-term operation or interacts with a remote process. It does not provide a user interface.
All services developed by developers are subclasses of Android. App. Service.
4. Content Provider
Provides data for applications.
In Android, data is stored in the file system, SQLite database, web, and other persistent storage locations. through content provider, other applications can query or even modify the data (pay attention to authorization ).
Content provider can also operate the private data of an application.
Content provider can be implemented from Android. content. contentprovider.
Activate Components
Activities, services, and broadcast receivers can all be activated by intent.
Activity activation can be performed by passing an intent object to startactiviy () or startactivityforresult ().
Service Activation can be bound to a service by passing an intent to startservice () or an intent to bindservice.
Development Environment:
1. SDK
2. Eclipse
2. ADT (Android development plug-in under eclipse)