I just want to add another way to connect sources for the support library. It requires ADT in version 20 or later. Presumably, this method works for all JARs for which the source / javadoc location setting is disabled by the container. Here is what you need to do:
The android-support-v4.jar is located in the libs directory of your project. In the same directory, create a regular Java properties file, named the same as the JAR, but with the extension .properties added. So, for our support library this will be:
android-support-v4.jar.properties .
Open the created properties file and set the value of the property with the name src in the place where the sources for this library can be found. Your file should have one line:
src=c:/apps/adt-bundle-windows-64bit/sdk/extras/android/support/v4/src
Save the file.
Close and reopen the android project.
Try moving to one of the support classes. Now the source application should work.
Works great in my case.
It should be noted: if src not an absolute path, it will be resolved starting from the parent directory of the JAR file. Take the support library as an example - if src=support/src , ADT will assume that the class sources are located in libs/support/src .
A brief description of this feature, written by its author, can be found here .
If anyone is interested in exactly how this .properties file is handled, I recommend reading patch set # 4, esp. changes to eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/ internal/project/LibraryClasspathContainerInitializer.java :)
Edit
Also, take a look at WindRider’s excellent commentary on properly adding sources to a project with multiple reference libraries.
andr Dec 19 '12 at 23:33 2012-12-19 23:33
source share