Port Android to different devices
Android allows different hardware platforms and drivers to support Android running. The Hardware Abstraction Layer provides a standard interface between the software stack of the Android platform and Hardware devices. In addition, the Android operating system is open-source, which can help you quickly develop software and allow software and hardware to work collaboratively.
To ensure the high quality of Android devices and a unified user experience, you must pass the Compatibility test suite ). CTS can ensure that devices developed by anyone comply with unified standards, and applications can run reliably and have a good experience.
Underlying Android system architecture
Before you port Android to your hardware device, it is very important to have an understanding of how android works at a higher level. Because the driver has a lot of interaction with the Source code of HAL and other parts of the Android system, understanding this part is very important for you to learn other parts of the Source code of the entire AOSP (Android Open Source Project. The following figure shows how Android works at the system level.
Figure 1. Android system architecture
Application Framework)
This layer is a concern of most application software developers. Here, you need to understand that many interfaces provide the same functions as the lower-Layer HAL interfaces for the application programming interfaces (APIS) available for developers. Therefore, this part can help you understand how to implement the driver.
Binder inter-process communication
The Binder inter-process communication mechanism allows the application framework to call functions provided by Android system services across processes. This basically allows high-level framework APIs to interact with Android system services. From the perspective of the application framework, all communications are hidden for developers, and things seem to work very well ".
System Service
Most of the functions provided by the application framework layer APIs need to communicate with system services to access the underlying hardware. Service personnel are divided into different functional modules to complete different functions, such as window Manager, search service and Notification Manager ). system services are divided into two groups: system and multimedia ). system services include windows and notification managers. Multimedia services include all the services related to playing and recording multimedia.
Hardware Abstraction Layer)
HAL provides a standard interface for the Android system to call the underlying driver, while shielding the implementation of the underlying driver and hardware. You must implement the Hardware Abstraction interface or driver for the hardware on the product. Android does not require standard interfaces implemented by drivers and HAL. You can make adjustments based on the actual situation of your products. However, you must ensure that all HAL interfaces can correctly interact with the underlying hardware. All HAL implementations are compiled into a dynamic link library.
Linux Kernel
Development of Android device drivers is the same as development of standard Linux device drivers. Android uses a special version of Linux and adds some device drivers, such as wakelock, a memory management system, and Binder inter-process communication drivers, which are very important to the embedded platform. These new functions are mainly related to system functions. You can use any version of the kernel, as long as it supports specific features, such as the binder driver. However, we recommend that you use the latest version of AndroidKernel.