Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add source + javadoc for android-support-v7?

I added to my project support library android-support-v7-appcompat, but I can't add source and javadoc for it.

I downloaded https://android.googlesource.com/platform/frameworks/support/+/master package with source and in Eclipse I set Source attachment to v7/appcompat/, but it doesn't work.

Can someone help me?

E: my solution is, I have two projects in Eclipse "android-support-v7-appcompat" (original lib from android-sdk\extras\android\support\v7\appcompat) and "android-support-v7-appcompat-src" (src from android.googlesource.com) and when I compile release version, so I used original lib and for debug I used src from googlesource.com.

PS: sorry for my english

like image 896
Jozka Jozin Avatar asked Aug 18 '13 11:08

Jozka Jozin


People also ask

How do I add the v7 Appcompat support library?

In the Properties window, select the "Android" properties group at left and locate the Library properties at right. Select /path/to/appcompat/ and Click Remove. Click Add to open the Project Selection dialog. From the list of available library projects, select v7 appcompat library and click OK.

Which v7 support libraries are used for modifying UI settings?

v7 Preference Support Library The preference package provides APIs to support adding preference objects, such as CheckBoxPreference and ListPreference , for users to modify UI settings. The v7 Preference library adds support for interfaces, such as Preference. OnPreferenceChangeListener and Preference.

What is the Android support library?

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.


2 Answers

I was able to attach the source based on advice from How do I attach the Android Support Library source in Eclipse?.

Here's what I did:

First, clone the source repository and get whatever version corresponds to the released library (which I guessed):

  1. git clone https://android.googlesource.com/platform/frameworks/support
  2. cd support
  3. git checkout android-4.3.1_r1

Next, in Eclipse:

  1. Right-click project and choose Properties.
  2. Select Java Build Path
  3. Select the Libraries tab
  4. Add External JARs > YourProject/libs/android-support-v7-appcompat.jar (I know your project had already referenced to it but don't worry, just add it again).
  5. Expand jar and attach Source to the External Jar: WhereverYouHaveTheSource/support/appcompat
  6. Switch to the "Order and Export" tab, move the external jar above the "Android Dependencies"
like image 114
Kristopher Johnson Avatar answered Sep 18 '22 18:09

Kristopher Johnson


Or the same using @andr answer to How do I attach the Android Support Library source in Eclipse?

git clone https://github.com/android/platform_frameworks_support android_sources_folder

add android-support-v7-appcompat.jar.properties file into libs (next to android-support-v7-appcompat.jar) with content

src=D:\\android_sources_folder\\platform_frameworks_support\\v7\\appcompat\\src

close and reopen project

like image 31
Paul Verest Avatar answered Sep 21 '22 18:09

Paul Verest