View the Android app source code in eclipse

Source: Internet
Author: User

First of all, I have to scold me for a bunch of other methods on the Internet, that is, none of the methods I want, and each one I do, maybe I am stupid. After all, we finally got it done. The process is as follows:


First, go to the development/IDE/Eclipse/directory of the android source code directory. There are three files in this directory, two of which can be seen directly, one. the classpath file is hidden by default. If you want to see it and select Show Hidden Files (the above mentioned are all Linux Files, It is troublesome to download the source code for Windows. install some things that simulate Linux... Personal dislike ).

Copy the Android. importorder, android-formatting.xml file (. classpath is not required, if you are in the Linux Android source code directory for development may need, see online information), put it in a directory.

In your windows eclipse preference-> JAVA-> code style-> formater/organize imports respectively set android. importorder, android-formatting.xml import (do not import seems not good, it seems that the import order is very important, otherwise it has been Red Cross ).

Finally, create an android project and copy all the app source code you downloaded to the android project you just created (the Java project mentioned on the internet is directly changed in the android source code ), everything is OK. Run the compilation to check the effect.


Write is a bit messy. Here is a brief summary:

1. Copy Android. importorder and android-formatting.xml to windows under the $ Android-source-DIR/development/IDE/eclipse directory of Android source.

2. import these two files to the relevant attributes of eclipse respectively (preference-> JAVA-> code style-> formater/organize imports ).

3. Create an android Project (not a Java project ).

4. Copy the downloaded app Source Code (for example, gallery3d Source Code) to the android project you just created. Everything is OK;


Note: There is a problem with environment. isexternalstorageremovable () in gallery3d. If I cannot find this method, I am surprised. I did it twice, and I did not report an error at the same time. If an error is reported, comment it out.

Good luck

(I went back to the dormitory to solve the problem. I was afraid of mistaken people. I deleted it, but I could do it on the company's computer. I could do it again on a virtual machine. So I should keep it. It may be useful to some people)

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.