Android Deep Exploration 1-4 chapters experience

Source: Internet
Author: User
Tags version control system

Chapter I.

Android system itself is a huge system, porting does not need to master Every part of Android, need to consider is the hardware abstraction Layer of Android system (HAL) and the Linux related device drivers in the.

The purpose of porting the Android system is to run the Android system on specific hardware . In the process of transplantation, it is important to grasp the key points and reduce the workload. From the perspective of work, the usual method is to familiarize yourself with the interface of the hardware abstraction layer, its secondary integration and reuse of existing drivers, and the main workload in the implementation of the hardware abstraction layer. In order to better understand and debug the system, you should also know the upper layers of the hardware abstraction layer of the call situation.

There are two main areas of work in the area of migration:

Linux Drivers

Android System hardware Abstraction Layer

Linux drives work in the kernel space,theandroid system hardware Abstraction layer works in user space, with the combination of these two parts, you can make the huge android The system runs on a specific hardware platform.

After you have a specific hardware system, you typicallyLinuxDrivers are required to implement them, which are typicallyLinuxthe standard driver for theAndroidplatforms and otherLinuxThe platform is basically the same. The main implementation aspect isAndroidhardware abstraction layer in the system(Hardware Abstract Layer), the hardware abstraction layer is used for loweringLinuxprovides an interface to theAndroidother parts of the system(is usuallyAndroidLocal Framework Layer)called.

Chapter II

There are five steps to complete The deployment of an Android development environment:

1 install jdk

Jdk java se  Development kit java   development Toolbox. se represents the Standard Edition. jdk Yes java java java runtime environment java tools and the one that is called when developers develop applications java class library.

the basic tools included in the JDK are:

Javac:Java compiler, turn source code into bytecode.

Jar: Package Tool to package related class files into one file.

Javadoc: Document generator, extracting documents from source notes.

Jdb:Debugger, debug Debugging tool.

Java: Run the compiled java program.

2. Configure the variable environment for JDK on Windows :

When the system is required to start an application, the system will first look in the current directory, if not the path specified in the system variable path to find. We said earlier that the jdk contains a bunch of development tools that are located in the JDK 's installation directory, and to facilitate the use of these development tools, it is necessary to have the JDK the installation directory set the system variable. This is why you need to set up the bin of the JDK after installing the jdk in Windows The directory is the reason for the system environment variable.

3. Download and install Eclipse :

Eclipse is an IDE (Integrated development environment) developed for Java applications and Android . Eclipse does not need to be installed, after the download unzip the package, cut the Eclipse folder to the place where you want to install, open when you set up your working directory.

4. Download and install the Android SDK :

Configured withJDKvariable environment, installedEclipse, this time if only to develop ordinaryJAVAapplication, thenJavadevelopment environment is ready. We're going throughEclipseto developAndroidapplication, then we need to downloadAndroid SDK(Software Development Kit) and inEclipseinstallationADTplugin, this plugin allowsEclipseand theAndroid SDKassociated with them.

5. Install the ADT plugin for Eclipse :

To make Android apps easier to create, run and debug,android 's development team is dedicated to the Eclipse IDE a plugin was customized: Android Development Tools ( ADT ).

Chapter III

Git is currently the most advanced Distributed version control system in the world.

Repository also known as the Warehouse, English name repository, you can easily understand a directory, all the files in this directory can be managed by Git , each file modification, deletion, Git can track it so that it can track history at any moment, or "restore" the file at some point in the future.

Workspace: The directory you see on your computer, such as the files in testgit (except the. git hidden directory repository ). or later, you need to create a new directory file, and so on is the workspace category.

Repository: The workspace has a hidden directory . Git, This is not part of the workspace, this is the repository. There are a lot of things in the repository, the most important of which is stage ( staging Area ), and Git automatically creates the first branch for us. Master, and Point to Master A pointer to HEAD .

There are two steps to submitting a file to the repository using Git :

The first step is to add the file using git add , which is actually adding the file to the staging area.

The second step: Commit the change using git commit , which is actually committing all the contents of staging area to the current branch.

The Create and Merge branch commands are as follows:

View branches:git branch

Create a branch:git branch name

Switch branches:git checkout name

Create + Switch branch:git checkout –B name

Merge a branch to the current branch:git merge name

Delete branch:git branch –d name

Fourth Chapter

Ubuntu Environment Download Android code

installation of Git and Repo

First make sure to create a /bin directory (if not) in the current user's home directory, and then add it (~/bin) to the PATH environment variable.

Install git

sudo apt-get install Git-core curl

This command installs Git-core and Curl from the Internet's software warehouse.

Initializing the repository if you want to take down all the sourcecode of the latest version of Android's current thread , we need repo help.

First set up a directory, such as ~/myandroid , in the future with the repo init command.

Repo Init-u Git://android.git.kernel.org/platform/manifest.git

The Sync repository uses the repo sync command to sync the entire Android code tree to the local, so you can use a similar repo sync Project1 project2  ..... This command synchronizes a few items if you are synchronizing A single item in Android, just perform a simple git pull in the project directory .

SourceCommand( fromC Shelland Come) is aBash Shellbuilt-in commands. Point command, which is a dot symbol,( fromBourne Shelland Come) is aSourcethe other name. Similarly, the variables configured in the current script will also be used as the scripting environment,Source (or Point) commands are typically used to re-execute a newly modified initialization document, such as. Bash_profileand the. profileand so on.

Android Deep Exploration 1-4 chapters 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.