Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I use new " V7 Appcompat library ", do I still need " V4 Support Library " for a minimum SDK = 7?

I am migrating from Action Bar Sherlock to Action Bar compat. I remove ABS and I had support-v4-google maps in it, I got errors. I will add the v4 directly to the project now to see if it solve, but I want to know:

I don't really understand from the documentation if libraries are redundant or complementing?

Thanks for advice, pointers etc.

EDIT: This is the error that make me added v4 with "external jar... " It solve it.

The type android.support.v4.app.TaskStackBuilder$SupportParentable cannot be resolved. 
It is indirectly referenced from required .class files

But if u say i should not add v4 if already have v7 how do I explain it to Eclipse?

Relevant post, the solution was to add v4 here. The hierarchy of the type activity is inconsistent when extending ActionBarActivity

Edit 2: The v4 jar is included in the v7 library project if done following these steps point by point: http://developer.android.com/tools/support-library/setup.html#add-library My setup is :

  • Android 4.3 : unchecked
  • APrivate Lib: unchecked
  • v7-app.../src : checked
  • v7-app.../gen : checked
  • ADependencie: unchecked
  • raw v7 jar : check
  • raw v4 jar : check
like image 900
Poutrathor Avatar asked Aug 06 '13 15:08

Poutrathor


People also ask

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.

How do I add a library Android support v7 Appcompat in Android Studio?

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.

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.


3 Answers

v7 includes the v4 support library so there is no need to have it in there again

if you look in the libs folder of the v7 support library you will see that the v4 jar is already referenced in the library

like image 85
tyczj Avatar answered Oct 19 '22 07:10

tyczj


V7 is the new version of the android-support library, just something new things implemented in V7 of V4 support library. So the all method and class of v4 are available inside the v7.

So if you add v7 library then no need to add v4 library.

like image 5
Sunil Kumar Avatar answered Oct 19 '22 08:10

Sunil Kumar


If you are using Android Studio the default way the v7 support library is included is maven dependencies defined in you build.gradle file.

dependencies {
    compile 'com.android.support:appcompat-v7:18.0.0'
}

The appcompat-v7 .aar file does NOT contain the v4 classes. You can see this by looking in your build/exploded-bundles/ComAndroidSupportAppcompatV71800.aar folder. What I have found is that if you create a new project it will also include the .jar file for v4 from the SDK folder.

like image 2
Shaun Kutch Avatar answered Oct 19 '22 07:10

Shaun Kutch