what dependency should I use to do: import io.reactivex.Completable import…
- User
what dependency should I use to do: import io.reactivex.Completable import io.reactivex.Flowable
- Assistant
You can use the following dependency to use RxJava and its associated classes:
implementation 'io.reactivex.rxjava2:rxjava:2.2.19'This will provide access to the
CompletableandFlowableclasses, as well as other RxJava functionalities. - User
if I do this: implementation "io.reactivex.rxjava2:rxjava:rxjava_version in my android project?
- Assistant
You can define
rxjava_versionin your project'sbuild.gradlefile as a variable. Add the following line at the beginning of thebuild.gradlefile:ext { rxjava_version = '2.2.19' }This will define a variable
rxjava_versionwith the value'2.2.19'. Now you can use this variable in the dependencies section like this:implementation "io.reactivex.rxjava2:rxjava:$rxjava_version"If you need to change the version of RxJava in the future, you can simply update the value of
rxjava_versionin thebuild.gradlefile.