Use legacy support library option in android
Asked Answered
S

4

24

Should I select the Use legacy android.support libraries option when creating a new project? What will happen if I don't select this option?

image

Sambo answered 11/6, 2020 at 13:3 Comment(1)
You can use the support libraries or androidx libraries but not mixing them.The default option is the 2nd one since the support libraries are deprecated.Azaleah
P
25

A little context:

Up until recently, almost every Android app used the android.support libraries so that they could use features introduced on new Android versions also on older Android versions. You can read about it here: https://developer.android.com/topic/libraries/support-library

Recently, Google announced that there would be no new releases for the support library, and that instead the support library would become a new library called AndroidX. Here's their announcement:

With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.

You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

So all Android apps should now aim to use AndroidX, instead of the old support library. When you create a new project in Android Studio, it will by default use AndroidX, but you can still choose to Use legacy android.support libraries if you wish, by clicking the checkbox you found.

Most of the time, you probably want to use AndroidX

Palate answered 11/6, 2020 at 13:33 Comment(0)
B
7

With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components. Support Library

If you check this option, the android studio will use android.support library otherwise it will use androidx library.

the android.support library is deprecated, so you don't need to check this option.

Bidwell answered 11/6, 2020 at 13:32 Comment(0)
A
1

The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.

Check the artifact-mappings and also check support-library

Adames answered 11/6, 2020 at 13:11 Comment(0)
G
0

When developing apps that support multiple API versions, you may want a standard way to provide newer features on earlier versions of Android or gracefully fall back to equivalent functionality. Rather than building code to handle earlier versions of the platform, you can leverage these libraries to provide that compatibility layer. In addition, the Support Libraries provide additional convenience classes and features not available in the standard Framework API for easier development and support across more devices.

Gizzard answered 14/10, 2022 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.