1.2 introduction to the Android platform
Android platformA group of software packages for mobile devices, including an operating system, middleware, and key applications. Developers can use the android SDK (software development kit) to create applications for this platform. Applications are written in Java and run in Dalvik. Dalvik is a custom virtual machine designedEmbeddedThe application is designed to run on the upper layer of the Linux kernel.
1.2.1 features of the Android platform
· Application Framework supports Component Reuse and replacement
· The Dalvik virtual machine is specially optimized for mobile devices.
· Integrated browsers are based on open-source WebKit Engines
· Optimized graphic mechanism custom 2D graphics library, based on OpenGL ES 1.0 standard 3D graphics implementation (this item is optional for hardware accelerators)
· SQLite lightweight database, supporting storage of structured data
· Media supports common audio, video, and static image file formats (MPEG4, H.264, MP3, AAC, Amr, JPG, PNG, and GIF)
· GSM technology: Global System for Mobile Communications (relying on Hardware Support)
· Bluetooth, edge, 3G, and WiFi (dependent on Hardware Support)
· Camera, GPS, compass, and accelerometer (dependent on Hardware Support)
· Rich development environment: rich development environment, including a set of hardware simulators, some tools for program debugging, memory and performance analysis, and plug-ins supporting eclipse integrated development environment (ADT ).
1.2.2 Android platform architecture
The following figure shows the main components of the Android operating system. For more details about each part, see the following description.
Android platform architecture
1.2.3 applications (applications)
Android will pre-install a set of core applications, including email clients, SMS services, calendar, map services, browsers, contacts and other applications. All applications are written in the Java programming language.
1.2.4 Application Frameworks (Application Framework)
The core applications mentioned above are developed based on framework-level APIs, which can be fully used by programmers. The original intention of the application architecture design is to simplify the Component reuse mechanism. Any application can release its own functions, these functions can be used by any other application (of course, they must be subject to the mandatory security specifications from the Framework ). Similar to the reuse mechanism, the framework allows component replacement.
All applications are a group of services and systems, which generally include:
· A set of rich and scalable view components, including lists, grids, text boxes, buttons, and even embedded web browsers
· Content providers (content providers) enables an application to access data (such as contacts) of another application, or allow an application to share its own data.
· Resource Manager (Resource Manager), which provides access channels for non-encoding resources, such as localized strings, images, and layout files
· Notification Manager enables applications to display custom alarm notifications in the status bar.
· Activity Manager manages the lifecycle of an application and provides general navigation rollback support.
For more details, see the Tutorial "Android Application writing".
1.2.5 Libraries)
Android contains a set of C/C ++ libraries. All components of the Android system are used. These functions are exposed to developers through the Android Application Framework. The following lists some core databases:
· System C library-Implementation of the Standard C system library (libc) derived from BSD (Note: BSD: Berkeley Software Distribution, Berkeley software suite, is a UNIX derivative system, the University of California (Berkeley) in the 1970 s, particularly supporting embedded Linux-based devices.
· Media libraries-the media library is based on packetvideo's opencore. The media library supports many popular audio and video formats and static graphics files (including MPEG4, H. playback and recording of 264, MP3, AAC, Amr, JPG, and PNG)
· Surface Manager-management scope: Access to subsystem display functions, seamlessly combining 2D and 2D graphic layers across applications
· Libwebcore-is a popular browser engine that supports Android browsers and Embedded Web View components of applications.
· SGL-underlying 2D graphics engine
· 3D libraries-Based on OpenGL ES 1.0 API; this class library uses a hardware 3D accelerator (if supported by hardware) or a built-in, highly optimized 3D Software Acceleration mechanism.
· FreeType-supports bitmap and Vector Fonts
· SQLite-a competent and lightweight Relational Database Engine for all applications
1.2.6 Android Runtime (Android runtime)
The core library of Android provides the vast majority of functions provided by the Java class library.
Every android application runs on its own process and has the VPC instance assigned to it by the Dalvik virtual machine. Dalvik has been rewritten to support efficient running of multiple virtual machines on the same device.
The Dalvik virtual machine executes an executable file (. Dex) in the Dalvik format. This format is optimized to minimize memory consumption. The Java compiler converts Java source files to class files, and the class files are converted to Dex files by the built-in DX tool. These files are registered and run on the Dalvik virtual machine.
The Dalvik virtual machine depends on the Linux kernel for some underlying functions, such as thread and low memory management.
1.2.7 Linux kernel (Linux kernel)
Android relies on Linux 2.6 and provides core system services: security, memory management, process management, network group, and driver model. The kernel is equivalent to an abstract layer between the hardware layer and other software groups in the system.