Linux C + + engineers 2 hours to learn about Android records
Source: Internet
Author: User
<span id="Label3"></p><p><p>(a) Android?</p></p><p><p>Andoid is a linux-only operating system for mobile terminals, not a redhat-like server os, or a standard desktop OS similar to windows, but a simpler graphic os,android application using Java development for handheld Devices. Android from Linux kernel branch, such as my Huawei mobile phone Android is 4.3, using the Linux kernel is 3.4.</p></p><p><p>Android code has been removed by the Linux kernel Community. Android has inherited the Linux kernel code, according to the Linux GPL rules that the open source code of any modification, must open source, so Android open Source. While Android is an ASL license, the ASL license rules that you can freely use the code without open source, so applications and drivers on Android seem to be closed source, which also satisfies the requirements of many hardware Vendors.</p></p><p><p>Unlike liinux embedded development using system calls and glibc interfaces, Android does not have glibc support for its own use of the BIONICLIBC library. and, according to the needs of the mobile Terminal OS refining its own set of interfaces, developers developed on the Android interface, the Android interface is a series of Java base Class library we mentioned BELOW.</p></p><p><p>An additional question: Why Android uses the Linux kernel:</p></p><p><p>A: Answer this question need to understand the role of the kernel, the kernel provides process Management/file network Management/system security rights Management. The kernel is invisible to the upper-level operator and can only be manipulated for the provided operating Interface. So the kernel is basic to the whole system, not functional.</p></p><p><p>Borrowing knowledge on the words, developing a kernel is not difficult, difficult in thousands of devices for him to do the Driving. Apple and windows have independent hardware or the ability to persuade hardware vendors to drive, but at the beginning of android, Linux is the only Option.</p></p><p><p></p></p><p><p>(ii) Android Application Components</p></p><p><p>The Android application does not prepare a separate program entry for the application (for example, without the main method), but rather provides the basic components for the system to instantiate according to the Requirements. There are four different types of components:</p></p><p><p>Activity: an application can have one or more activity, and each user interface is a subclass of the activity-based class. The activity lifecycle consists of active/pause/stop,android that manage the lifecycle of the component and automatically destroy the activity component of the stop when the system needs memory.</p></p><p><p>Service: Background Service can do some file processing in the background, such as network processing, to provide the results to the needs of activity use, each service inherits the services class. The service runs within the main thread of the application process, and the time-consuming service is executed using the new County.</p></p><p><p>Broadcastrecvice: broadcast message receiving class, a component used to receive broadcast messages and make processing, many broadcast messages originate from system code such as time zone changes, low battery level, taking photos or changing language options.</p></p><p><p>Intent: a message component that is used for message passing between individual components.</p></p><p><p>Android threads are created with standard Java thread objects.</p></p><p><p>Android has a lightweight remote procedure call (RPC) mechanism that invokes a method locally, and then returns the result in Remoting.</p></p><p><p></p></p><p><p>(iii) Android enhancements to Linux kernel</p></p><p><p>Android's enhancements to kernel are mainly reflected in the enhancements to the Linux kernel Driver. Android will device drivers mentioned in userspace, not inherited in the Kernel.</p></p><p><p>1) Openbinder Framework driver, used to provide inter-process communication IPC function of Android platform, code in DRIVERS/STAGING/ANDROID/BINDER.C</p></p><p><p>2) Android Power management, a lightweight Android power management system based on standard Linux power management System.</p></p><p><p>3) Low Memory manager: more flexible than the oom mechanism, you can kill the process as needed to free up the required memory. Drivers/staging/android/lowmemkiller.c</p></p><p><p>4) Anonymous Shared Memory (ashmem) provides a large chunk of shared memory for the process, as well as a mechanism for managing and reclaiming this Memory.</p></p><p><p>5) Physical MEM: provides continuous physical memory space to the User.</p></p><p><p>6) Android Logger: Lightweight log device</p></p><p><p>7) Android Alarm: timer for Android customization/</p></p><p><p>8) YAFFS2 File System.</p></p><p><p></p></p><p><p>Linux C + + engineers 2 hours to learn about Android records</p></p></span>
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