androidx.lifecycle or android.arch.lifecycle

Viewed 1063

What is the difference between

android.arch.lifecycle vs androidx.lifecycle

Code:

val loading: LiveData<Boolean>
    get() = webDataSource.loading

When I try to auto-import, I need the arch version but it is importing the x version

I use both in the gradle file

1 Answers

"android.arch" was a way to add architecture components to projects before androidx. All-new support library development will occur in the androidx library. So the androidx package would contain new improvements and packaging structure.

Better to use the androidx components instead of "android.arch" components.

Related