Detailed explanation of the principles and development points of the android System

Source: Internet
Author: User
Tags skia

Android is a smartphone system developed by Google over several years and invested hundreds of millions of dollars. Google also launched an Open Mobile Alliance, an organization around Android, which is called "Open Handset Alliance" in English ".

With the development and production of Android-based mobile smart devices by major mobile terminal manufacturers, Android has quickly been recognized by the industry and society and has become a hot topic in the whole industry, various talents based on the Android platform gradually become the focus of competition among major enterprises.

Android is an open system that can be used by any company, individual developers, and enthusiasts. For technicians, Android is not only a smartphone system, but also a complete software platform for learning embedded Linux systems.

Android is a newer system and technology. Therefore, there are few materials and books about Android, especially books in simplified Chinese. This book, detailed explanation of the principles and development points of the Android system, is a book that comprehensively introduces the Android system. It is developed based on the experience of multiple expert authors in the androidin community.

Android, as a huge system, includes the Linux operating system, a variety of local programs, virtual machines and runtime environments, Java framework and Java applications. This is a great challenge for beginners. Therefore, it is very important to grasp the context of the system and use appropriate learning methods for learning, researching, and developing Android systems, this is also the subject of this book.

Features

To adapt to the situation of the Android system, this book has the following important features in content orchestration and organization.

Integrity and hierarchy

This book focuses on the four levels of the Android system, which are described in chapters and focuses on the code structure, compilation system, related tools, and various organizations of the entire android system. This will allow readers to gain a general understanding of the Android system even if they only spend a short period of time.

Provide a clear framework

Android is a large system of hundreds of megabytes, and each part is organically linked. This requires Android learning and developers to have some knowledge about software architecture. This book draws a large number of blocks for the overall and key modules of Android, which is very helpful for readers to intuitively understand the system. This book lists the paths of relevant code to help readers quickly and efficiently learn each part.

Focus on core content

Android has released several versions: 1.0, 1.5 (cupcake), 1.6 (donut), and 2.0 (eclair). From the development perspective, each version is used at the same time, this is a big challenge for learners. Therefore, the author tries his best to summarize the common content and present it to readers by grasping the context of Android evolution. In some parts, while explaining the code, highlight the conceptual content. This book strives to provide readers with long-term and stable learning methods and ideas through a textbook.

Development details

Android contains a large number of software, programs, and tools, involving various aspects of software development. In the actual development process, many content does not need to be modified by developers. From the perspective of engineering, this book focuses on the Content commonly used in development. It only gives a rough introduction to the less involved parts in development. This book focuses on the display mechanism, input mechanism, the transplantation layer of the audio/video system, the construction of multimedia systems, the construction of telephone systems, the construction of connection systems, the value shifting of sensors, and the most widely used in application development. often involved, in each section, the skills that can be used in development are interspersed.

Contents

The chapters in this book and their organization are as follows.

Chapter 2 "Android system overview" describes the content of the Android system, including the development history of the smartphone platform, features of the Android system, and development of Android, and two different Android development methods.

Chapter 2 "Android system development overview" describes the comprehensive content of Android system development, including tool usage, code acquisition, compilation system, simulator running, and SDK usage.

Chapter 2 "android Linux kernel and drivers" describes the features of the android kernel, the dedicated drivers used in Android, and the standard device drivers that may be used by Android systems.

Chapter 2 "underlying Android libraries and programs" describes the basic programs of the Android system, mainly local programs.

Chapter 2 "android Java Virtual Machine and Java environment": related content between the local and Java layers, this section describes the basic concepts of Dalvik, the environment of the android Java program, the use of JNI, And the Startup Process of the Java framework.

Chapter 2 "android GUI system ", including the android GUI system architecture, underlying pixelflinger and libui libraries, surface systems, skia and 2D graphics systems, Android OpenGL and 3D graphics systems.

Chapter 2 "android audio system" is mainly used for audio input and output. The audio system has content from the driver, local framework to Java framework.

Chapter 2 "android Video Input and Output System" describes the android Video Input and Output System, which consists of the overlay system and the camera system. The former has only local content, the latter has content at all levels.

Chapter 2 "android Multimedia System" describes the core of Android multimedia system, it includes the business and structure of the Multimedia System in Android, the core framework of the multimedia system, and the structure and usage of the opencore system.

Chapter 2 "Android phone part" describes Android phone functions. Android is a smart phone system and telephone is its core part.

Chapter 2 "android connection" mainly includes WiFi, Bluetooth, and positioning systems. These Android connections also have a structure from the driver layer to the Java application layer.

Chapter 2 "android sensor system": the sensor system involves all layers of Android and has a complete structure. Compared with other systems, the sensor system is easy at all levels.

6th ~ Chapter 12 introduces several core Android systems in modules, including the local framework and Java framework, and the application and driver layers. This is the focus of this book.

Chapter 2 "Android Application overview and Framework" introduces the basic concepts and Application Framework of the Android Application Layer. This part is the 13th bottom-up layer of Android, it can be developed based on source code or SDK, and the difference between them is very small.

Chapter 2 "main aspects of Android Applications" describes all aspects of Android Application Layer Development, basically horizontal content, it includes three aspects: Basic Control of applications, use of various UI elements, and use of graphic APIs.

Chapter 2 "Android Application Design Ideas": This chapter is based on the general design ideas of general applications and GUI programs, combined with the characteristics of the Android system, put forward some noteworthy issues and design methods.

Readers of this book

This book is suitable for the majority of readers, and strives to provide readers with comprehensive support in the aspects of Android system transplantation, application development, and system framework improvement. Different readers should use different methods when learning this book.

Android beginners: Read the code and build a system development environment under the guidance of this book. for Android Application developers, focus on the content in the last three chapters.

Android medium and senior developers: Learn the system architecture and focus on the Development points through the guidance of this book, and try to use the general design ideas, software engineering ideas, and system engineering ideas of the mobile phone system to guide Android system learning.

Embedded Linux system learners: Learn android as a system integrating the Linux core and application layer programs, and run and Debug programs using the android simulation environment.

In the course of learning this book, readers should try to compare the block diagram of this book with the android source code at hand, so as to get twice the result with half the effort. This book adds a lot of comments to the key code to help readers read it. For non-key code, it does not take up the length of this book. Readers can refer to open source code. You can use a combination of sequential reading and key reading to learn this book. Sequential reading focuses on the system framework and development points.

Author of this book

This book extracts and integrates the experiences of early Android Developers, the development achievements of the androidin community in mainland China, and the experience and technology of experts. It is the source of knowledge for publishing this book. This book is designed and edited by Han Chao and Liang Quan, two core technical experts from the androidin community. Based in Southern California, mappun wireless (mappn Inc.), which focuses on the Android platform and provides its mobile application development and solutions, has also invested technology and manpower in the work of this book.

He also participated in the compilation of this book, including Shi Lin, Zhang Yu, Zhang Chao, and others. Zhao Jiawei, Huang Liang, Shen Yu, Xu Witt, and Yang Yu participated in the review.

Due to the rush of time, there may still be some errors and problems. Please forgive me. You are welcome to discuss and give some advice.

Title: AndroidSystem principles and key points of Development

Author: Han Chao, Liang Quan By

ISBN 978-7-121-10138-0

Publication date: 2010Year1Monthly Publishing

Pricing:58.00RMB

Start: 16Open

Page number: 412Page

Internal Capacity Introduction

This book comprehensively introduces the Open Mobile Phone platform Android system, including the Linux driver, local framework, Java framework and Java application in the Android system. The content of this book is based on the knowledge content and focuses on the Development points. The content of each part focuses on mutual care and introduces the principles and development methods of the entire android system to readers based on clear ideas.

This book focuses on developing Android applications and building hardware abstraction layers based on the framework of the Android system and the main thread of each subsystem. The content covers Android Application Development and Android system transplantation to build a mobile phone system.

This book is not only suitable for engineers engaged in Android development at all levels, but also for learners of General Embedded Linux systems.

Before Yan

Android is a smartphone system developed by Google over several years and invested hundreds of millions of dollars. Google also launched an Open Mobile Alliance, an organization around Android, which is called "Open Handset Alliance" in English ".

With the development and production of Android-based mobile smart devices by major mobile terminal manufacturers, Android has quickly been recognized by the industry and society and has become a hot topic in the whole industry, various talents based on the Android platform gradually become the focus of competition among major enterprises.

Android is an open system that can be used by any company, individual developers, and enthusiasts. For technicians, Android is not only a smartphone system, but also a complete software platform for learning embedded Linux systems.

Android is a newer system and technology. Therefore, there are few materials and books about Android, especially books in simplified Chinese. This book, detailed explanation of the principles and development points of the Android system, is a book that comprehensively introduces the Android system. It is developed based on the experience of multiple expert authors in the androidin community.

Android, as a huge system, includes the Linux operating system, a variety of local programs, virtual machines and runtime environments, Java framework and Java applications. This is a great challenge for beginners. Therefore, it is very important to grasp the context of the system and use appropriate learning methods for learning, researching, and developing Android systems, this is also the subject of this book.

Features

To adapt to the situation of the Android system, this book has the following important features in content orchestration and organization.

Integrity and hierarchy

This book focuses on the four levels of the Android system, which are described in chapters and focuses on the code structure, compilation system, related tools, and various organizations of the entire android system. This will allow readers to gain a general understanding of the Android system even if they only spend a short period of time.

Provide a clear framework

Android is a large system of hundreds of megabytes, and each part is organically linked. This requires Android learning and developers to have some knowledge about software architecture. This book draws a large number of blocks for the overall and key modules of Android, which is very helpful for readers to intuitively understand the system. This book lists the paths of relevant code to help readers quickly and efficiently learn each part.

Focus on core content

Android has released several versions: 1.0, 1.5 (cupcake), 1.6 (donut), and 2.0 (eclair). From the development perspective, each version is used at the same time, this is a big challenge for learners. Therefore, the author tries his best to summarize the common content and present it to readers by grasping the context of Android evolution. In some parts, while explaining the code, highlight the conceptual content. This book strives to provide readers with long-term and stable learning methods and ideas through a textbook.

Development details

Android contains a large number of software, programs, and tools, involving various aspects of software development. In the actual development process, many content does not need to be modified by developers. From the perspective of engineering, this book focuses on the Content commonly used in development. It only gives a rough introduction to the less involved parts in development. This book focuses on the display mechanism, input mechanism, the transplantation layer of the audio/video system, the construction of multimedia systems, the construction of telephone systems, the construction of connection systems, the value shifting of sensors, and the most widely used in application development. often involved, in each section, the skills that can be used in development are interspersed.

Contents

The chapters in this book and their organization are as follows.

Chapter 2 "Android system overview" describes the content of the Android system, including the development history of the smartphone platform, features of the Android system, and development of Android, and two different Android development methods.

Chapter 2 "Android system development overview" describes the comprehensive content of Android system development, including tool usage, code acquisition, compilation system, simulator running, and SDK usage.

Chapter 2 "android Linux kernel and drivers" describes the features of the android kernel, the dedicated drivers used in Android, and the standard device drivers that may be used by Android systems.

Chapter 2 "underlying Android libraries and programs" describes the basic programs of the Android system, mainly local programs.

Chapter 2 "android Java Virtual Machine and Java environment": related content between the local and Java layers, this section describes the basic concepts of Dalvik, the environment of the android Java program, the use of JNI, And the Startup Process of the Java framework.

Chapter 2 "android GUI system ", including the android GUI system architecture, underlying pixelflinger and libui libraries, surface systems, skia and 2D graphics systems, Android OpenGL and 3D graphics systems.

Chapter 2 "android audio system" is mainly used for audio input and output. The audio system has content from the driver, local framework to Java framework.

Chapter 2 "android Video Input and Output System" describes the android Video Input and Output System, which consists of the overlay system and the camera system. The former has only local content, the latter has content at all levels.

Chapter 2 "android Multimedia System" describes the core of Android multimedia system, it includes the business and structure of the Multimedia System in Android, the core framework of the multimedia system, and the structure and usage of the opencore system.

Chapter 2 "Android phone part" describes Android phone functions. Android is a smart phone system and telephone is its core part.

Chapter 2 "android connection" mainly includes WiFi, Bluetooth, and positioning systems. These Android connections also have a structure from the driver layer to the Java application layer.

Chapter 2 "android sensor system": the sensor system involves all layers of Android and has a complete structure. Compared with other systems, the sensor system is easy at all levels.

6th ~ Chapter 12 introduces several core Android systems in modules, including the local framework and Java framework, and the application and driver layers. This is the focus of this book.

Chapter 2 "Android Application overview and Framework" introduces the basic concepts and Application Framework of the Android Application Layer. This part is the 13th bottom-up layer of Android, it can be developed based on source code or SDK, and the difference between them is very small.

Chapter 2 "main aspects of Android Applications" describes all aspects of Android Application Layer Development, basically horizontal content, it includes three aspects: Basic Control of applications, use of various UI elements, and use of graphic APIs.

Chapter 2 "Android Application Design Ideas": This chapter is based on the general design ideas of general applications and GUI programs, combined with the characteristics of the Android system, put forward some noteworthy issues and design methods.

Readers of this book

This book is suitable for the majority of readers, and strives to provide readers with comprehensive support in the aspects of Android system transplantation, application development, and system framework improvement. Different readers should use different methods when learning this book.

Android beginners: Read the code and build a system development environment under the guidance of this book. for Android Application developers, focus on the content in the last three chapters.

Android medium and senior developers: Learn the system architecture and focus on the Development points through the guidance of this book, and try to use the general design ideas, software engineering ideas, and system engineering ideas of the mobile phone system to guide Android system learning.

Embedded Linux system learners: Learn android as a system integrating the Linux core and application layer programs, and run and Debug programs using the android simulation environment.

In the course of learning this book, readers should try to compare the block diagram of this book with the android source code at hand, so as to get twice the result with half the effort. This book adds a lot of comments to the key code to help readers read it. For non-key code, it does not take up the length of this book. Readers can refer to open source code. You can use a combination of sequential reading and key reading to learn this book. Sequential reading focuses on the system framework and development points.

Author of this book

This book extracts and integrates the experiences of early Android Developers, the development achievements of the androidin community in mainland China, and the experience and technology of experts. It is the source of knowledge for publishing this book. This book is designed and edited by Han Chao and Liang Quan, two core technical experts from the androidin community. Based in Southern California, mappun wireless (mappn Inc.), which focuses on the Android platform and provides its mobile application development and solutions, has also invested technology and manpower in the work of this book.

He also participated in the compilation of this book, including Shi Lin, Zhang Yu, Zhang Chao, and others. Zhao Jiawei, Huang Liang, Shen Yu, Xu Witt, and Yang Yu participated in the review.

Due to the rush of time, there may still be some errors and problems. Please forgive me. You are welcome to discuss and give some advice.

Contents Recording

Chapter 1 Overview of Android 1

1.1 Basic Knowledge 1

1.1.1 origin of Android Development System 1

1.1.2 Mobile Phone System Development Mode 2

1.1.3 future mobile phone functions and Android advantages 4

1.2 Android development 6

1.2.1 Android porting development 6

1.2.2 Android Application Development 8

1.2.3 Android system development 9

1.3 Android SDK and source code 10

1.3.1 SDK-based Android development 10

1.3.2 Android development 11 based on the source code SDK

Chapter 1 Android system development overview 13

2.1 Android system architecture 13

2.1.1 Software Architecture 13

2.1.2 Android tool 16

2.2 Android source code development environment 18

2.2.1 obtain and submit Android Source Code 18

2.2.2 Android source code structure 21

2.2.3 compiling 24

2.2.4 System Operation 25

2.3 Android SDK Development Environment 32

2.3.1 SDK Structure 32

2.3.2 windows SDK Development 33

2.3.3 Linux SDK Development 42

Chapter 4 Linux kernel and driver for Android 44

3.1 Linux core and driver 44

3.2 Android driver 45

3.2.1 ashmem 45

3.2.2 binder 45

3.2.3 logger 46

3.3 device drivers used by Android 46

3.3.1 framebuffer display driver 46

3.3.2 event Input Device Driver 48

3.3.3 v4l2 camera-video drive 50

3.3.4 OSS audio driver 53

3.3.5 ALSA audio driver 54

3.3.6 MTD driver 56

3.3.7 Bluetooth driver 57

3.3.8 WLAN driver 58

Chapter 2 Android underlying libraries and programs 60

4.1 structure of underlying libraries and programs 60

4.1.1 basic structure of local implementation 60

4.1.2 Method for adding local programs and libraries 61

4.2 Standard C/C ++ library bionic 64

4.3 C language tool library libcutils 65

4.4 init executable program 66

4.5 shell tool 72

4.6 C ++ tool library libutils 75

4.6.1 libutils basic content 75

4.6.2 binder 76

4.6.3 other content in libutils 82

4.7 Android system process 85

4.7.1 servicemanager 85

4.7.2 zygote 87

Chapter 2 Android Java Virtual Machine and Java environment 88

5.1 Dalvik Virtual Machine and core database 88

5.1.1 Dex tool library and Virtual Machine implementation 89

5.1.2 core database 90

5.1.3 nativehelper library 91

5.2 Android Java program environment 91

5.2.1 Java class hierarchy 91

5.2.2 Android Java code 92

5.2.3 Android system API 92

5.3 JNI 96

5.3.1 JNI architecture and implementation method 97

5.3.2 JNI implementation method 97

5.3.3 use JNI 99 in applications

5.4 System Service Java part 101

5.4.1 binder102

5.4.2 servicemanager 103

5.4.3 system process 103

Chapter 2 Android GUI system 6th

6.1 Android GUI system overview 106

6.2 pixelflinger and libui library 108

6.2.1 pixelflinger 108

6.2.2 libui 108

6.2.3 output/input and hardware interfaces 109

6.3 surface system 113

6.3.1 surface system Local interface 113

6.3.2 surfaceflinger local code 115

6.3.3 Java and JNI code 119 of Surface

6.4 skia and 2D graphics system 121

6.4.1 skia underlying database 121

6.4.2 JNI interface 124 of Android Graphics System

6.4.3 graphical package for Android 125

6.5 Android OpenGL and 3D graphics systems 125

6.5.1 local code of OpenGL 125

6.5.2 JNI code 130 of OpenGL

6.5.3 Java class 130 of OpenGL

Chapter 2 Android audio system 7th

7.1 audio system overview 132

7.2 audio system and upper layer interface 134

7.2.1 audio system levels 134

7.2.2 Audio Framework section 135 in the media library

7.2.3 audioflinger local code 138

7.2.4 JNI code 140 of the audio system

7.2.5 Java code 142 of the audio system

7.3 audio Hardware Abstraction Layer 142

7.3.1 audio hardware abstraction layer interface definition 142

7.3.2 audioflinger self-built audio Hardware Abstraction Layer 144

7.3.3 real implementation of the audio Hardware Abstraction Layer 150

Chapter 2 Android Video Input and Output System 8th

8.1 Video Input/Output System Overview 151

8.1.1 Android overlay architecture 152

8.1.2 camera system structure of Android 153

8.2 Overlay System 155

8.2.1 definition of the overlay system framework part 156

8.2.2 overlay Section 158 of surfaceflinger System

8.3 overlay Hardware Abstraction Layer 161

8.3.1 interface of the hardware abstraction layer of the overlay system 161

8.3.2 hardware implementation framework of Overlay System 164

8.3.3 precautions for implementing overlay system hardware 166

8.4 camera system and upper layer interface 169

8.4.1 camera local code framework 169

8.4.2 cameraservice 176

8.4.3 JNI code 179 of camera

8.4.4 Java code 182 of camera

8.5 camera Hardware Abstraction Layer 182

8.5.1 interface definition for the hardware abstraction layer of camera 182

8.5.2 Implementation of the hardware abstraction layer of camera 184

8.5.3 hardware implementation of the camera Hardware Abstraction Layer 188

Chapter 2 Android multimedia system 9th

9.1 structure and business of Android multimedia system 190

9.1.1 multimedia system macro structure 190

9.1.2 various multimedia services 192

9.2 all levels of multimedia systems 199

9.2.1 framework part 199 of libmedia

9.2.2 multimedia service 208

9.2.3 JNI code 213 of multimedia Section

9.2.4 multimedia Java framework code 215

9.2.5 Android. widget. videoview class 216

9.3 core of multimedia implementation opencore 216

9.3.1 opencore overview 216

9.3.2 opencore hierarchy 217

9.3.3 opencore oscl Section 219

9.3.4 opencore file format and CODEC part 221

9.3.5 opencore node 222

9.3.6 extended functions of opencore 223

9.3.7 player 226 of opencore

9.3.8 opencore author 236

Chapter 2 Android phone part 10th

10.1 Android phone summary 243

10.2 modem driver 243

10.3 local RIL code 245

10.3.1 introduction 245

10.3.2 rild daemon 246

10.3.3 libril library 247

10.3.4 RIL implementation Library Reference RIL 247

10.3.5 request process (request) 248

10.3.6 response (response) process 249

10.3.7 RIL porting 251

10.4 Java framework and application 251

10.4.1 base architecture 252

10.4.2 call 255

10.4.3 text message 256

10.4.4 data connection 257

10.4.5 other frameworks and other applications 258

Chapter 2 Android connection section 11th

11.1 WiFi part 259

11.1.1 basic WiFi architecture 259

11.1.2 260 local WiFi

11.1.3 WiFi Java and JNI 263

In 11.1.4 settings, the WiFi settings 265

11.1.5 WiFi workflow instance 265

11.2 Bluetooth part 267

11.2.1 Bluetooth basic architecture 268

11.2.2 Bluetooth user space library bluez 269

11.2.3 bluez adaptive layer 272

11.2.4 Bluetooth JNI and Java Section 272

11.3 GPS and positioning part 280

11.3.1 positioning system basic architecture 281

11.3.2 system driver layer 281

11.3.3 local implementation of GPS 282

11.3.4 gps jni 283

11.3.5 Positioning System JAVA Implementation 284

Chapter 2 Android sensor system 12th

12.1 Sensor System Overview 286

12.2 sensor system hierarchy 288

12.2.1 sensor system levels 288

12.2.2 JNI 288 of Sensor System

12.2.3 sensor system Java code 290

12.3 Hardware Abstraction Layer of sensor systems 291

12.3.1 sensor system hardware abstraction layer interface definition 291

12.3.2 Implementation of the hardware abstraction layer of the Sensor System 293

12.3.3 key points of the hardware abstraction layer of the sensor system 296

12.4 sensor usage 296

Chapter 2 Android Application overview and framework 13th

13.1 Android Application Development Method 299

13.2 Android app content 300

13.2.1 conceptual description of the Android Application 300

13.2.2 each file contained in the application 305

13.2.3 use the am tool to start Android app 306

13.3 Android Application Example 308

13.3.1 helloactivity 308

13.3.2 helloactivity source code structure 308

13.3.3 helloactivity compilation structure (source code development) 312

13.3.4 helloactivity compilation structure (SDK Development) 314

13.4 Android Application Layer api reference document 315

Chapter 2 main aspects of Android applications 14th

14.1 basic application control 318

14.1.1 UI elements and control 318

320 jump between screens

14.1.3 dialog box and menu 324

14.1.4 set the style 328

14.1.5 use service 331

14.1.6 use broadcast receiver 337

14.2 use of various UI elements 339

14.2.1 basic UI element 340

14.2.2 view group usage 345

14.2.3 custom view 353

14.2.4 use of the scroll view 354

14.2.5 layout (layout) 355

14.2.6 grid view group 359

14.2.7 list view group 360

14.2.8 use tab 362

14.3 use of graphic APIs 363

14.3.1 API 363 for 2D graphics

14.3.2 3D image API 366

Chapter 2 design thoughts of Android applications 15th

15.1 Android program ideology 369

15.1.1 Java source code idea 369

15.1.2 thoughts on resources 373

15.1.3 idea of Project Description document 375

15.1.4 Trinity idea 376

15.1.5 security and permissions 378

15.1.6 use of APP widgets 379

15.2 Android Application Development Instance 381

15.2.1 GUI dependent class program 382

15.2.2 separate module class program 387

15.3 Android design philosophy 393

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.