Appcompat, compatibility, and support libraries for Lollipop if minimum SDK = 14
W

2

7

We have an existing Android app that supports API Level 8 up to 18. We used compatibility libraries 19.1.0. Now we are changing/upgrading to:

  1. Minimum SDK = 14
  2. Target = android-22

Now given that there are v4, v7, v13 support, compatibility, and appcompat libraries in different versions, I'm not sure which ones to include and which ones not.

We are using maven for dependency management and using Maven SDK deployer

Wishbone answered 14/3, 2015 at 14:14 Comment(1)
This goes further than just SDK requirements, it is functionality dependent. If you don't need something from a certain support library in the first place there is no reason to include it. Take a look at what the support libraries themselves contain. developer.android.com/tools/support-library/features.htmlMadness
T
7

If you are using a minSDK of 14 then technically you do not need any of them. However, here are things to think about:

Support v4 (com.android.support:support-v4:23.0.0)

  • App Components Fragment - Adds support for encapsulation of user interface and functionality with Fragments, enabling applications to provide layouts that adjust between small and large-screen devices.
  • NotificationCompat - Adds support for rich notification features.
  • LocalBroadcastManager - Allows applications to easily register for and receive intents within a single application without broadcasting them globally.
  • User Interface ViewPager - Adds a ViewGroup that manages the layout for the child views, which the user can swipe between.
  • PagerTitleStrip - Adds a non-interactive title strip, that can be added as a child of ViewPager.
  • PagerTabStrip - Adds a navigation widget for switching between paged views, that can also be used with ViewPager.

App Compat v7 (com.android.support:appcompat-v7:23.0.0)

Here are a few of the key classes included in the v7 appcompat library

  • ActionBar - Provides an implementation of the action bar user interface pattern. For more information on using the Action Bar, see the Action Bar developer guide.
  • ActionBarActivity - Adds an application activity class that must be used as a base class for activities that uses the Support Library action bar implementation.
  • ShareActionProvider - Adds support for a standardized sharing action (such as email or posting to social applications) that can be in an action bar.

Support v13 (com.android.support:support-v13:23.0.0)

This library is designed to be used for Android 3.2 (API level 13) and higher. It adds support for the Fragment user interface pattern with the (FragmentCompat) class and additional fragment support classes. For more information about fragments, see the Fragments developer guide. For detailed information about the v13 Support Library APIs, see the android.support.v13 package in the API reference.

See their revisions here: http://developer.android.com/tools/support-library/index.html

See all of the libraries listed here: http://developer.android.com/tools/support-library/features.html

Throwback answered 14/3, 2015 at 14:25 Comment(4)
Any time, so many formatting options :P Thanks for taking the time to post the content for others.Madness
Is there a generic best practice? Say, that generally it's better to use non-support libraries. Or that v7 has a rich set of libraries and so it's usually recommended to have it?Wishbone
@Wishbone I would use AppCompat v7(it depends on Support v4), so you will use both. It includes everything you need to Material Design and Android best practices. With AppCompat you can set your minSDK to 7 and target 22(latest).Throwback
I am having trouble running a very simple app using support-v13 on Android 4.0.4. I can replicate this over and over again. I am having this error: #32803992Phial
W
8

Android Support Library v4, v7, v8, v13 and v17 are totally different libraries. v7 is not the newer version of v4 and v8 is not the newer version of v7. You can't find a component provided by v7 in v4 and with the same reason, you can't find a component provided by v8 in v7.

The number of each v indicate the minimum Android version that library provided inside can be backward compatible. For example, if you use a v8 component. You application will be able to run on a phone with API Level 8 and above. If you need to use a component from both v7 and v8, you have to include BOTH of them to your project.

Since your minSdkVersion is now 14, you are safe to use any of v4, v7, v8 and v13.

Please note that the latest version of Android Support Library is now 22.0.0. I suggest you to move from 19.1.0 to 22.0.0. It is far better.

Walkup answered 14/3, 2015 at 14:22 Comment(0)
T
7

If you are using a minSDK of 14 then technically you do not need any of them. However, here are things to think about:

Support v4 (com.android.support:support-v4:23.0.0)

  • App Components Fragment - Adds support for encapsulation of user interface and functionality with Fragments, enabling applications to provide layouts that adjust between small and large-screen devices.
  • NotificationCompat - Adds support for rich notification features.
  • LocalBroadcastManager - Allows applications to easily register for and receive intents within a single application without broadcasting them globally.
  • User Interface ViewPager - Adds a ViewGroup that manages the layout for the child views, which the user can swipe between.
  • PagerTitleStrip - Adds a non-interactive title strip, that can be added as a child of ViewPager.
  • PagerTabStrip - Adds a navigation widget for switching between paged views, that can also be used with ViewPager.

App Compat v7 (com.android.support:appcompat-v7:23.0.0)

Here are a few of the key classes included in the v7 appcompat library

  • ActionBar - Provides an implementation of the action bar user interface pattern. For more information on using the Action Bar, see the Action Bar developer guide.
  • ActionBarActivity - Adds an application activity class that must be used as a base class for activities that uses the Support Library action bar implementation.
  • ShareActionProvider - Adds support for a standardized sharing action (such as email or posting to social applications) that can be in an action bar.

Support v13 (com.android.support:support-v13:23.0.0)

This library is designed to be used for Android 3.2 (API level 13) and higher. It adds support for the Fragment user interface pattern with the (FragmentCompat) class and additional fragment support classes. For more information about fragments, see the Fragments developer guide. For detailed information about the v13 Support Library APIs, see the android.support.v13 package in the API reference.

See their revisions here: http://developer.android.com/tools/support-library/index.html

See all of the libraries listed here: http://developer.android.com/tools/support-library/features.html

Throwback answered 14/3, 2015 at 14:25 Comment(4)
Any time, so many formatting options :P Thanks for taking the time to post the content for others.Madness
Is there a generic best practice? Say, that generally it's better to use non-support libraries. Or that v7 has a rich set of libraries and so it's usually recommended to have it?Wishbone
@Wishbone I would use AppCompat v7(it depends on Support v4), so you will use both. It includes everything you need to Material Design and Android best practices. With AppCompat you can set your minSDK to 7 and target 22(latest).Throwback
I am having trouble running a very simple app using support-v13 on Android 4.0.4. I can replicate this over and over again. I am having this error: #32803992Phial

© 2022 - 2024 — McMap. All rights reserved.