Use Android Studio to view the Android 5. x source code

Source: Internet
Author: User

Use Android Studio to view the Android 5. x source code

Reading and editing the AOSP Source code is the most annoying part in Machine Development. This article gives you the opportunity to get rid of Eclipse and Source Insight tools.

Google brings Android Studio to Android Developers to replace Eclipse. Since the emergence of Android Studio, the whole machine development and Android source code reading and editing will certainly be able to use it. This article mainly introduces how Android Studio imports the Android AOSP source code.
Currently, only the code after Android Lollipop has been tested. It is unclear whether the project before Android 5.0 supports it. As follows:

There are no complicated configurations. A few simple commands are as follows:

1. Generate the IDE tool File
mmm development/tools/idegen/

After running, the idegen. jar file is generated.

2. Generate the Android Studio configuration file

Mainly generate android. iws, android. ipr, android. iml: these three files are key files of the Android Studio project. They are mainly used to list projects consisting of modules, dependencies, and directory structures.

sh ./development/tools/idegen/idegen.sh
3. Import the project

Open Android Studio, File-> Open-> Project root directory android. ipr. Android automatically imports all the code of the project. The long indexing process takes 30 ~ About 120 minutes.
Process: The config prompt of the framework is displayed in the index. Click config and confirm. The indexing will continue for a period of time.
End: After indexing is complete, select project view to see the clear code structure at the beginning of the article.

4. Advantages and Disadvantages

Advantages:
1. Made by Google
2. Good code reading environment
3. Excellent code editing functions, prompt and method redirection
4. Powerful plug-ins are said to support
Disadvantages:
1. It is recommended that the 8g take-off memory be standard.

Goodbye Source Insight! Goodbye to Eclipse!

 

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.