How to import the Android system source code to Android studio: androidstudio

Source: Internet
Author: User

How to import the Android system source code to Android studio: androidstudio

The directory structure of the Android source code is as follows:

| -- Makefile
| -- Abi (applicationbinary interface, which is an application binary interface that generates libgabi ++. so library files)
| -- Art (google added after 4.4 to replace Dalvik runtime)
| -- Bionic (Android C library, that is, the C library file)
| -- Bootable (startup guide code)
| -- Build (stores Basic Development Configuration packages such as system compilation rules and generic)
| -- Cts (Android compatibility test suite Standard)
| -- Dalvik (dalvik Java Virtual Machine)
| -- Developers (used by developers to store several examples)
| -- Development (some routines and tools required by developers)
| -- Device (device-related code, which is the code that each vendor needs to configure and modify)
| -- Docs (about open-source documentation)
| -- External (some open-source modules used by android)
| -- Frameworks (core framework -- java and C ++ language)
| -- Hardware (some open-source hardware solution Adaptation Layer HAL code)
| -- Kernel (driver kernel-related code)
| -- Libcore (core library related)
| -- Libnativehelper (library used by JNI)
| -- Ndk (ndk-related)
| -- Out (the code output directory after compilation)
| -- Packages (Application Package)
| -- Pdk (what google uses to reduce fragmentation)
| -- Prebuilt (resources pre-compiled in x86 and arm architectures)
| -- Sdk (sdk and simulator)
| -- Tools)
| -- System (underlying file system library, applications and components -- C language)
| -- Vendor (vendor-defined code)

 

We can find that there is a development folder in the source code root directory, which contains some routines and tools required by developers. to import the Android system source code to Android studio, we need to use the tools in it.

 

First, importing system source code requires a large amount of memory, so you need to change the value of-Xms and-Xmx in the studio64.exe.vmoptions1_studio.exe. vmoptions file in the binfile folder of the Android studioinstallation directory ).

 

Next, execute the initialization commands related to the Android System Code compiling environment, and then execute the following command:

mmm development/tools/idegen/

Then execute

development/tools/idegen/idegen.sh

And so on.

Read excludes: 13msTraversed tree: 143977ms

After execution, the android. ipr and android. iml files are generated under the root directory of the source code. Open the Android. ipr file using android studio and you can import the system source code.

Because the source code of the Android system is large and time-consuming to import data, we recommend that you modify android. iml to exclude some code. The syntax is as follows:

<excludeFolder url="file://$MODULE_DIR$/.repo" />

 

Refer:

Http://www.cnblogs.com/Lefter/p/4176991.html

Http://www.jianshu.com/p/c2389cb35565

 

Related Article

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.