Windows Eclipse 查看Android 源码(Ubuntu)

    使用Eclipse 既可以查看Android 源码,也可以基于源码调试(Application)部分,非常好用。

   开发环境:Windows7 上使用 Eclipse (下载这个Classic 版本的http://www.eclipse.org/downloads/packages/eclipse-classic-372/indigosr2 , 如果你不知道JDK装的是64还是32位的,选择32位的Eclipse ),远程访问服务器Ubuntu上的代码。

   这种情况下查看以及调试Android 的方法在好多地方都可以找到,不过原始来源都是google 的官方文档:

   http://source.android.com/source/using-eclipse.html

    这里说的是查看基于Android 源码建立开发环境,如果只是基于SDK 开发,可能要看这里:https://developer.android.com/tools/sdk/eclipse-adt.html

    1.先编译源码: http://source.android.com/source/building.html

cd /path/to/android/root 
make
  

    2. 拷贝.classpath到android源码的根目录 :

Eclipse needs a list of directories to search for Java files. This is called the "Java Build Path" and can be set with the.classpath file. We have a sample version to start you off.   

cd /path/to/android/root 
cp development/ide/eclipse/.classpath .
chmod u+w .classpath

    3.增大Eclipse JVM Memmory 设置:

       修改eclipse.ini 文件, 在Eclipse安装目录。

-Xms128m 
-Xmx512m 
-XX:MaxPermSize=256m

These settings set Eclipse's minimum Java heap size to 128MB, set the maximum Java heap size to 512MB, and keep the maximum permanent generation size at the default of 256MB.

    4.启动Eclipse,新建工程(Java 工程),选择“Create project from existing source”,目录填入Android源码根目录, wait 。。。.

    5.Eclipse Formatting。

     android 源码里 development/ide/eclipse 下两个文件可以帮助规范代码的格式(与Android原生的格式一致.

   

  1. Select Window > Preferences > Java > Code Style.

  2. Use Formatter > Import to import android-formatting.xml.

  3. Organize Imports > Import to import android.importorder.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值