简体   繁体   中英

How can I see the source code of packages in Eclipse?

i started to learn android program ,and i curious to see the code of the classes/ for example the class of import android.app.Activity.

how can i see the source code of the packages in eclipse?

You can attach source code to libraries. yourProject / Properties / Java Build Path / Libraries / yourLibrary / Source attachment, and then enter the folder or zip file containing the source code (which you need to download separately).

If you only have the object code (.class files), then you need to learn to read ByteCode (which Eclipse shows pretty nicely) or use a Java ByteCode disassembler.

As in android sdk what we get is a compiled jar file which contains all the classes. So in eclipse you can't read the source, but you may use, The official online version to read the source code of classes:

http://developer.android.com/reference/packages.html

[In eclipse although by CTRL+Click on import may show you a bit about the class, although that won't be easy to understand :)]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM