Chapter 1-4 Experience

Source: Internet
Author: User

The first chapter:

Android transplant is divided into Android application porting and Android system porting, in Android system porting, Linux drive as a focus to make it as a base to run, on the basis of the source code to make changes or add it to implement unique features. Linux kernel layer: Linux kernel and Driver module. Linux has 3 types of device drivers, character device drivers, block device drivers, and network interface drivers.

Prerequisites for Linux Driver development:

1. Operating system

2. Build Linux-driven development environment

3. Test Linux drivers under this system.

HAL layer: A hardware abstraction layer that isolates the Android framework from the kernel, and the development of the Android framework without having to consider too many kernel drivers. HAL is not open source, the HAL layer exists mainly in Google in order to protect the hardware manufacturer's driver, do not open source and confidential hardware specifications.

The LED driver code that controls the 4 LEDs on the S3C6410 board involves a number of system functions and structures, such as READL, Writel, PRINTK, and so on. The drive is device-driven.

Chapter II:

Android low-level development requires configuration of the development environment that drives the development environment, Android applications, and the Android NDK program, as well as additional tools to test Linux drivers and debug the Development Board.

Tools needed to develop, test, and debug Linux drivers, HAL libraries:

1, JDK6 or above version

2, Eclipse3.4 or above version

3. ADT (for developing Android apps)

4. CDT (used to develop Android NDK program)

5. Android SDK

6. Android NDK

7. Cross-compilation environment

8. Linux Kernel source code

9. Android Source code

10. Serial Tool for debugging Development Board: minicom

Build an Android development environment:

1. Download and install the JDK

2. Build Android Application development environment

(1) Download and install the Android SDK

(2) Installing eclipse

(3) Installing ADT

(4) Establishment of AVD

3. Install Android NDK Development environment

(1) Download Android NDK

(2) Installing the CDT (plug-in for developing a/C + + program)

(3) command line compile Android NDK program

(4) Example of importing the Android NDK

Import the <android NDK installation directory >/samples/hello-gl2 directly into Eclipse and recompile to run on your phone

(5) Configuring the Android NDK integrated development environment

4, install the cross-compilation environment. (You can download the integrated cross-compilation environment from the Internet, you can also make your own)

Chapter III:

Git has extraordinary performance and the most optimized storage capabilities, and is superior in every way to other similar source control software such as CVS, SVN

1. Install git (many Linux systems come with git, no need to reload, and can reload the latest version)

2. View the GIT documentation (use the Man command to view the help document that made the command)

Source code submission and acquisition:

1. Create repository: Git init

2. Submit the file to the local repository git commit

3. Create a local branch: Git Branch

4. Switch local branch: Git Checkout

5. Create an open source project on the Git hub

6. Upload the source code to Git hub:git push

7. Download the source code from the Git hub

The fourth chapter:

Download and compile the source code

1, the Android source code download Environment configuration

(1) Create a directory to hold the download script file (repo)

(2) Download repo script file (for download Android source code)

(3) Create a directory to hold the Android source code (can be placed in other directories)

(4) initialization

(5) Download Android source code

2, Android source code directory structure analysis

3. Download part of the Android source code (using the Repo Sync command or using the git clone command)

4. Compiling Android source code

(1) Initializing the Android compilation environment

(2) Set the compilation target using the lunch command

(3) Compiling Android source code

5, Out directory structure analysis

6. Publish your apk as an Android built-in program

7. Test system.img file with simulator

Download and compile the Linux kernel source code

1. Download the Linux kernel source code

2, the Linux kernel source code directory

3, install the Android kernel compilation environment

(1) Prepare

(2) Unzip the compiler

(3) Verifying the cross-compilation environment

(4) Installation libncurses5

(5) Configuring and compiling the Linux kernel

Chapter 1-4 Experience

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.