在Eclipse中导入整个Android系统代码

来源:互联网 发布:网络桥接模式 编辑:程序博客网 时间:2024/05/22 13:27

原文参考:http://source.android.com/source/using-eclipse.html

cd /path/to/android/root

cp development/ide/eclipse/.classpath .

chmod u+w .classpath # Make the copy writable

然后打开eclipse,导入Android的代码风格文件android-formatting.xml

Windows->Preferences->Java > Code Style >formatter

然后选择Android过程下面的development/ide/eclipse/android-formatting.xml

然后再在Code Style中的 Organize Import中导入development/ide/eclipse/android.importorder

在ECLIPSE中的新建一个JAVA工程,工程名称可以自己随便填,这里使用Android

最重要的一步是不要使用默认的工程路径,不要沟选"use default location",要使用ANDROID的代码所在的顶层目录.

然后点击Finish,过段时间就可以看到整个ANDROID工程的代码了。

如果想要查看更多的工程代码,还可以修改.classpath文件,将需要查看的工程路径加入进去。