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)