This article is to record the relationship between drive layer, HAL layer and application layer in Android development, and its development method, this article will take the LED control as an example to record.
One is can be given after their own development to do the reference, and the second is to help the friends are learning reference.
The general app does not require us to focus on HAL and drivers, but when designing a hardware system, native Android does not provide the right services, so we need to understand the process. Because is also just getting started, many still do not quite understand, friends have what question can leave a message.
The first thing to know is what the Android app wants to do with the hardware and what kind of a process it is. In general, the app layer, the service layer, the hardware abstraction layer, the bottom drive.
I was learning and testing from the bottom up to the top. That is: Layer->app, Hardware abstraction layer, and so on. The reason is that the underlying driver needs to be identified first, and that the underlying driver can be tested using the Linux method, step to top of the application.
Driver code I directly affixed to, not to explain in detail the meaning of the inside, do not understand can refer to the Luo Shenyang "Android system source scenario analysis," the second chapter.
The code is as follows:
s5p4418 Android 4.4.2 Drive Layer HAL Layer Service Layer Application layer development process record (one hardware driver layer)