Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

androidx.lifecycle or android.arch.lifecycle

Tags:

android

kotlin

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

like image 239
johnrao07 Avatar asked Jul 08 '26 16:07

johnrao07


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.

like image 174
Swayangjit Avatar answered Jul 11 '26 07:07

Swayangjit