V4 and V7 on Android

3

Why in some examples on the internet, we find something like this:

<android.support.v4.view.ViewPager/>

<android.support.v7.view.ViewPager/>

What would this V4 and V7 be?

And in this example,

android.support.design.widget

What would this support be?

    
asked by anonymous 18.10.2016 / 14:38

2 answers

4

In summary, these are the Support Libraries for Android.

Android has numerous versions , and in each new version new APIs are created However, your application is usually not only developed for the newer version. This gives Google the Support Library Features .

v4 Support Libraries

According to Google, it's:

  

These libraries are designed to be used with Android 2.3 (API level 9) and higher. They include the largest set of APIs compared to other libraries, including support for application components, user interface features, accessibility, data handling, network connectivity, and programming utilities.

In translation, these libraries are designed to be used with Android 2.3 (API 9) and above. They include the highest number of API's in comparison to the other libraries.

To better understand what it includes, see package reference

v7 Support Libraries

According to Google, it's:

  

This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.

In translation, this library adds support for implementations of Material Design .

Some of the main classes included are:

Among others, such as:

  

I should note that the library v7 depends on the v4 library.

More Supports Libbrarys

In addition to the librarys mentioned above, Google has several more to help with development, such as:

For more details, you can check Google's Support Library Revision History .

    
18.10.2016 / 14:57
1
  

What would this V4 and V7 be?

Although the current documentation says that both are to be used from version 2.3 (API 9), the reason for the Vnn notation was to indicate which version of the SDK it is backward compatible (1) / sup>.

So V4 indicates that it can be used on Android 1.6+ (API Level 4 +) devices and V7 on Android 2.1+ (API Level 7 +) .

I do not know if the reason for changing the documentation is just because there are now very few devices running Android 1.6 and 2.1 and they are not compatible with the Google Play Store, or it is because the compatibility is really only from 2.3. / p>

  

What would this support be?

Support means support, support, help.

android.support.design.widget is the package name where some widget of Material Design that can be used in versions prior to Android 5 .

It exists in the Android Design Support Library that allows devices with Android versions to support Material Design .

(1) - I could not retrieve old documentation but there are answers in SOen that contain excerpts or experts such as CommonsWare that confirm this.

Note that android.support.v7.view.ViewPager does not exist.

    
18.10.2016 / 17:14