Android system architecture and android System Structure
Directory:
Android system architecture
After getting started with a simple Android Hello World, let's first take a look at the overall architecture of our Android system:
This is the overall architecture of Android. First, let's look at the overall architecture of Android.
Linux Kernel: We know that Android is actually an operating system, and its underlying layer is based on Linux Kernel. This layer mainly implements the functions of the operating system, for example, there are many drivers on this layer, which are used to drive the hardware devices on our devices.
Android Runtime: The running environment of Android. We all know that the running of java programs requires the support of the java core package, and then runs our applications through the JVM virtual machine, here, the Core Libraries in the Android Runtime is equivalent to the java JDK and the Core library required to run the android Application. The Dalvik Virtual Machine is equivalent to the JVM, at this time, Google developed a virtual machine for Android to run android applications.
Liberaries: these are all Android library files. For example, we access the library files of the SQLite database.
Application Framework: the Framework of an Application. This is very important. I believe that everyone should be familiar with the term Framework. What we learn about Android is this layer, we use various frameworks to implement our Application.
Application: This is the Application we developed.
Four common Android Components
The software development we currently advocate is developed based on components. components are similar to computer hardware. If I want to assemble a computer, you can directly buy each hardware and assemble it together. For the software, components are similar to this. We can develop a software and directly combine these components.
Android has four common components:
Activity, Service, ContentProvider, BroadcastReceiver
Activity: Activity is the interface of our application. It is mainly used to interact with our users. For example, in a text box, buttons are displayed on the Activity and can receive data, transmit the data to the background and then display it.
Service: We can't see the Service. For most of the data processing, the Service processing is done through the Service.
ContentProvider: similar to our archive, ContentProvider stores all kinds of data, such as information in the address book. This component is used to run a program to access the data and obtain the data in it.
BroadcastReceiver: The BroadcastReceiver component is a broadcast receiver used to monitor various behaviors of the system. For example, when the power is insufficient, a broadcast message is sent to us.
Activity Startup Process
After learning about the Android architecture, we can start code operations. First, let's look at a startup process of Activity:
When running our Android application, the Android operating system will first find our AndroidManifest. xml file. This file is the main configuration file of our application. Because one application may have multiple activities, which Activity will we first display? The main configuration file defines the Activity object that the current application loads by default. After finding this Activity object, it will call its onCreate () method, this method is mainly used to load our layout file. The setContentView () method can be used to load the specified layout file and display the control in the layout file on our screen. This is the starting process of our Activity.
Article by: http://www.cnblogs.com/xiaoluo501395377/p/3389411.html