When you get a stack trace in Eclipse with SDK classes on the stack, how can you see the SDK sources?

When you develop an Android application with the Eclipse plug-in and debugger and get a stack trace, you will not see any SDK source code. What steps do you need to take to fix this? Suppose a novice Java programmer.

To clarify, I want Eclipse to automatically show me the correct source files and lines when I go to the stack stack. I assume that I will need to find the right SDK sources, put them on my local system and then tell Eclipse how to find and use them. The question is how exactly do I take these steps.

+5
source share
3 answers

Thanks to lukehutch on the IRC # android channel, I pointed to a blog post that describes how to fix this problem.

The reason this is even a problem is because Google did not include sources in the SDK. There is an error to fix this problem.

The workaround described in more detail in the blog post is to get sources with git (I specified 1.0 for the repo command, which I hope corresponds to the SDK 1.0-r2), collects all java source files and puts them in the correct directory structure in sources / directory (which goes right next to your android.jar from the SDK) and update the jar in Eclipse, after which you can browse the sources of the SDK class.

, , SDK, : .

Python script, java .

+6

Eclipse (Debug- > Run as...) "sources"

"", , .

SDK Android, , Jar .

0

( 2.3.3) Google Code, :

cd path\to\android-sdk\platforms
svn checkout http://fanfq-android-demo.googlecode.com/svn/trunk/android-sdk-src/ .

Eclipse :

  • SDK F3
  • Click Attach Source> External File
  • Select the path \ to \ android-sdk \ platform \ android-xxx-y-src.zip

Now you should see the source when you press F3 on any Android class, as well as in the debugger, etc.

0
source

All Articles