"Turn" Android Learning Diary 01--Overview

Source: Internet
Author: User
Tags vector font

I. Overall framework

First, Google provides an official Android frame chart:

Android system architecture consists of 5 parts, namely: Linux Kernel, Android Runtime, Libraries, Application Framework, Applications (e-paper is not good to translate, In fact, this is also a simple computer e-text, the following are the main role of each part:

1. Linux Kernel

Android provides core system services based on Linux, such as: memory management, process management, network stacks, and drive models. Linux kernel also acts as an abstraction layer between hardware and software, which hides specific hardware details and provides a unified service for the upper layer. If you're just doing app development, there's no need to get into the Linux kernel layer.

2. Android Runtime

Android contains a collection of core libraries that provide most of the functionality available in the core class library of the Java programming language. Each Android application is an instance of a Dalvik virtual machine that runs in their own process. Dalvik virtual machines are designed to efficiently run multiple virtual machines on a single device. The Dalvik virtual machine executable file format is. The Dex,dex format is a compression format designed for Dalvik and is suitable for systems with limited memory and processor speed. Most virtual machines, including JVMs, are stack-based, while Dalvik virtual machines are register-based. Both architectures have pros and cons, and generally, stack-based machines require more instructions, and register-based machine instructions are larger. DX is a set of tools that convert Java. class to. dex format. A DEX file typically has more than one. Class. Since Dex has to be optimized, it will increase the file size by 1-4 times, ending with Odex. Dalvik virtual machines rely on the Linux kernel to provide basic functionality, such as threading and underlying memory management.

3, Libraries

Android consists of a collection of C + + libraries that are used by various components of the Android system. These features are exposed to developers through the Android application framework (application framework). Some of the core libraries are listed below:

    • System C Library -BSD derivative of standard C system library (LIBC), tuned to embedded Linux based devices
    • Media Library -Opencore based on PacketVideo. These libraries support the playback and recording of many popular audio and video formats, as well as still image files, including MPEG4, H, MP3, AAC, AMR, JPG, PNG
    • Interface Management --manage access to display subsystems and seamlessly combine multiple applications in two-and three-dimensional graphics layers
    • Libwebcore-a modern web browser engine that drives Android browsers and embedded web views
    • SGL--Basic 2D graphics engine
    • 3D Library --based on the implementation of OpenGL ES 1.0 APIs (Application programe Interfaces application interface). Library uses hardware 3D acceleration or contains highly optimized 3D software gratings
    • FreeType --bitmap and vector font rendering
    • SQLite -a powerful and lightweight relational database engine that all applications can use

4. Application Framework

By providing an open development platform, Android enables developers to develop extremely rich and innovative applications. Developers are free to take advantage of device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much more. Developers can fully use the framework APIs used by the core application. The architecture of an application is designed to simplify the reuse of components, and any application can publish his functionality and any other application can use these features (subject to the security restrictions enforced by the framework). This mechanism allows the user to replace a component.

All applications are actually a set of services and systems, including:

    • View--a rich, extensible collection of views that can be used to build an application. Includes lists, grids, text boxes, buttons, and even inline web browsers
    • content Providers-enables applications to access data from other applications (such as newsletters) or share their own data
    • Resource Manager (Resource Manager)-provides access to non-code resources such as localized strings, graphics, and layout files
    • Notification Manager (Notification Manager)--Enables all applications to display a custom warning in the status bar
    • ActivityManager-manages the application lifecycle, providing a common navigation fallback feature

5. Applications: Android assembles a core collection of applications, including email clients, SMS programs, calendars, maps, browsers, contacts, and other settings. All applications are written in the Java programming language.

Ii. Introduction to the development environment
1. Android SDK : Software Development Kit Software Development Kit
2, ndk : Native DK, similar to the SDK to facilitate the writing of C + + people, to achieve the Java+c Android development
3. The environment needs to be installed : JDK, Eclipse, Android SDK, ADT.

4, ADT: Google developed plug-ins, Android development Tools, integrated in Eclipse for Android development

Online Early tutorial Android development environment to carry on their own, more trouble, in fact, go directly to Google's official website to download the latest SDK,

Eclipse can be developed directly because Eclipse, SDK, ADT are all integrated. Of course the JDK still has to be installed on its own.

III. structure of Android project projects

Main folder or file features:

1, src Storage Project source code
2, the Gen directory to store R.java code
3, R.java defines some constants, these constants are the index of the resource file, so that we reference these resource files, corresponding to the RES resource folder drawable, Vaule, layout and other XML-based resource files
And R.java is read-only, do not let changes, resource file changes will automatically refresh, convenient phone memory management
4, Android.jdk is used to point to Android application development of all API library
5. Assert refers to external resources and does not generate indexes in R.java
6, Res Resources folder drawable, Vaule, layout files, respectively, the picture, string and layouts file, resource names can not use uppercase English letters

7. Bin folder holds compiled files, including Java compiled. class files, class files are converted to Dex files optimized for Dalvik virtual machines
8, Androidmanifest The current project configuration file, XML format, contains the encoding format, the app's icon, the program version number and the service used by the program
If you add a new activity, you need to configure it here, in Eclipse can be easily edited by manifest editor (right-click)

These files will eventually be compiled into an. apk file that is the Android app executable file for Android package file, the. apk file can be installed on the analog device or on the real machine.

Iv. configuration file Androidmanifest detailed

is the Androidmanifest grammar level, which is divided into 5 layers:
First layer: Manifest, defining the properties of the software, such as package path, program version
Second layer: Application, define the application's properties and information, such as specifying the application layer of the icon and theme, SD card read and Write permissions are also configured here, with Uses-permission
Third layer: Functional component layer, such as activity activities, services service, Broadcastreciver broadcast receive, provider content provider four components
Layer Fourth: Define what kind of intent (intent) requests the app receives Intent-filter
Layer Fifth: The type of action intent, the attribute of category intent, data intended to encapsulate

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.