为什么ubuntu10.04中eclipse关联android源码后,打开源码文件没有换行?

ameyume
博客专家认证
2011-04-14 09:37:47
ubuntu10.04
eclispe3.5.2
Adt:Android2.3.3
Android源码:android-2.3.3_r1-sources
例如,Ctrl + 鼠标点击Button,打开Button的源码,显示如下:
每个函数占一行,整个函数都没有换行。
package android.widget;
@android.widget.RemoteViews.RemoteView()
public class Button
extends android.widget.TextView
{
public Button(android.content.Context context) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); }
public Button(android.content.Context context, android.util.AttributeSet attrs) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); }
public Button(android.content.Context context, android.util.AttributeSet attrs, int defStyle) { super((android.content.Context)null,(android.util.AttributeSet)null,0); throw new RuntimeException("Stub!"); }
}

原因何在?
...全文
258 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
AstroboyAI 2012-07-04
  • 打赏
  • 举报
回复
应该是混淆打包了!防止反编译!如果需要看源码的话,可以去网上下载!应该是很多的!
ameyume 2011-04-20
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 ameyume 的回复:]

引用 6 楼 bluejoy345 的回复:

android源码里面没有sdk源码吗?

有,忘了从位于哪个目录下了。
[/Quote]
可以从源码的以下目录找到共有的API:
公有SDK源码可以在这里找到:mydroid/frameworks/base/core/java。在 那个文件夹下,你可以找到一个Android目录,它应该被拷贝到你的Android SDK 安装目录下的源码目录
http://hi.baidu.com/redtramp/blog/item/a9b5c38803a53584a5c272ff.html/cmtid/acfa254e83805ec4d0c86afa
ameyume 2011-04-20
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 ameyume 的回复:]

上面我是用
在Eclipse里关联Android源码的简单办法
这个方法设置,不知道是不是下载的源码太小的缘故,只有8.7M
源码是从http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android/2.3.3_r1下载的。

现在又重新下载了一个源码。http://lizo……
[/Quote]
各版本的api源码列表
http://code.google.com/p/lizongbo/downloads/list
ameyume 2011-04-20
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 bluejoy345 的回复:]

android源码里面没有sdk源码吗?
[/Quote]
有,忘了从位于哪个目录下了。
bluejoy345 2011-04-20
  • 打赏
  • 举报
回复
android源码里面没有sdk源码吗?
ameyume 2011-04-19
  • 打赏
  • 举报
回复
有没有人来接分阿?
ameyume 2011-04-18
  • 打赏
  • 举报
回复
上面我是用
在Eclipse里关联Android源码的简单办法
这个方法设置,不知道是不是下载的源码太小的缘故,只有8.7M
源码是从http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android/2.3.3_r1下载的。

现在又重新下载了一个源码。http://lizongbo.googlecode.com/files/android_gingerbread_javasrc.zip,33.7M,比上一个大了近30M.
按照以下方法设置后就ok了,关联的源码包含了注释,也能正常换行。
4.开始进行关联Android的源代码,在Eclipse中新建一个Android工程,选中工程,主菜单 –>Project–>Properties–>选择Android,Project Build Target选中Android 2.3。
然后再点左边的“Java Build Path”,切换到 Libraries 面板,展开 Android2.3 这个lib,点击android.jar的Source attachment,再点Edit.在对话框中点“External File”,选择E:/Java/android/javasrc/android_gingerbread_javasrc.zip,点OK进行确认。这样就把Android的java代码关联好了。
http://618119.com/archives/2011/01/01/201.html
ameyume 2011-04-14
  • 打赏
  • 举报
回复
自己up下,没有人遇到过这种情况吗?

80,360

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧