Android Learning Program

Source: Internet
Author: User

Recently was assigned to Android project team, engaged in the development of Android. On Android, it is only used to write some small programs on its application to play. I really did not think that one day, I also want to engage in this aspect of development. It's difficult, but it's also an opportunity to grow, and from the very beginning, it's a big challenge. This little team is not familiar with Android, we started exploring the journey. I hope that in the next time, I can record my learning process here.

For Android product development, some not only on the application layer above it to do Java development, there are many things Android bottom is not able to achieve our needs. In this case, we need to adapt, to add implementation, and so on, to solve the problem we encountered.

It's been about three weeks since the start of the exploration, and it's time to summarize your own explorations. Usually written in the company's online, can not be copied out, and now try to record their own learning here.

I. Overview of the Android framework

Figure 1 Android System framework diagram

This is the Android system frame diagram, from which can be seen, Android system structure is divided into four layers, from the bottom up to the core layer, the runtime layer, application framework layer, application layer.

kernel layer : The main or Standard Linux, which android to its own specific hardware and do the corresponding driver development, and the drive is abstracted to an Android HAL layer (Hardware abstraction layer). As to why this is done, there is a saying that if you develop directly on the Linux kernel, you need to adhere to the Linux open source strategy, which for many manufacturers involves the issue of trade secrets.

System Runtime Layer: system runtime layer, mainly by the C and C + + language development, implementation of the system interface calls and other operating modules. In this case, like LIBC implementation is not the usual Linux under the glibc, but by Android itself developed a llibc, called Bionic, only more than 200 k, the operating rate is significantly faster than the GLIBC implementation. But this has become my work a big difficulty point, because here, libc is the original glibc under some clipping, some functions do not realize, such as IPC interface, message sending interface, and memory sharing interface, etc. This allows the original Linux source to rely on these IPC interface code porting encountered a problem, how to solve this problem, is a major challenge to the program porting.

In the runtime layer, it also contains the following:

Surface Manager: The application layer of the display subsystem management, for the application layer to provide zero-3D and the integration of the undoubtedly;

Media Framework: Can support multiple formats of audio and video recording and playback, including the reading of the static image;

SQLite: A powerful lightweight database engine, which is supported by third parties, many databases are based on this sqlite as the database engine, the size of about 500K;

Opengl|es: Realize hardware acceleration of 3D image and soft acceleration after optimization;

FreeType: Font support for bitmaps and vector graphics;

WebKit: Powerful browser engine, many mainstream browsers are also based on this engine, such as Chrome, support Android browser, and support embedded Web view.

SGL: The underlying 2D graphics engine;

SSL: A security protocol that provides security and data integrity for network communications;

LIBC: As mentioned at the beginning, Android developed the Bionic, which provides standard system C calls.

In addition, the core libraries and Davik virtual machines are included here, Corelibraries provides a central library of Java, unlike the Java JVM, where the JVM is stack-based, and Davik is a register-based As to which of the two is good and which is bad, the industry is a controversial topic.

Application Framework Layer: In this case, the implementation of the bottom C + + call encapsulation, Android for development has provided the basic application interface, is Java implementation, Java calls the underlying C/S is implemented through the JNI mechanism. In this case, a good application framework development can provide better help for application invocation in the upper layer.

Application layer: The user most directly feel the first layer, which realizes the process of interaction with the user, regardless of the interface UI, or function, and the user relationship, this is good or bad determines the user's approval of the product bottom. Otherwise, the underlying package is better and useless.

Second, the next learning Plan

In the last three weeks, from the beginning of the download of Android source code, to its compilation process, directory structure, add C program running module learning, as well as the original Linux program portability analysis. More or less accumulated some, in the following days, I will continue to summarize these land on this.

Here's a list of topics I'm prepared to do:

1, Android source download and development environment to build

2, the Android compilation process analysis

3. How to add your own static library & dynamic library, including executable files, in the runtime layer on Android source

4. How to solve the problem of not supporting IPC on Android LIBC. (Summarize the process of analyzing the portability of the library under a Linux environment)

5, Analysis binder mechanism (Android's implementation of the IPC is the binder mechanism)

6, analyze the implementation mechanism of JNI in Android, and find some relevant module example analysis from the source code.

Summarize:

Android source analysis, encountered a lot of problems, but each time to solve a problem is a growth. In this process, the recording of problems is a kind of growth.

Android Learning Program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.