Our major technology shifts

RxJava → Coroutines / Flow
If you use Rx, you need to migrate to Flow or use some KMP alternatives like Reaktive.

Retrofit → Ktor
Ktor is a quite convenient network library. There were no major troubles with it. You just have to google a few times how to write what you were used to and that’s it.

Room → Room?
In my case the plain disk caching with Okio was an acceptable substitution. But in fact Room supports KMP as well.

Glide → Coil 3 + Self-made GIF implementation for iOS.
Coil 3 is still in alpha but it works. The problem in my case was the inability to play GIFs on iOS. Unfortunately it took me several days to figure out the issue and implement the solution with disk caching.

Caveats:

– Crash in the Jetbrains’ SVG parser on iOS that affects both Coil3 and Kamel.
The ticket is still unresolved.

– Coil 3 doesn’t support GIFs out of the box yet. You have to write it by yourself.
As well as disk cache for it.

The basic contract for images in my case:

@Composable
expect fun LoadableImage(
modifier: Modifier,
url: String,
imageColorFilter: ColorFilter? = null,
size: Size? = null,
)

Jetpack ExoPlayer → ExoPlayer + AVPlayer
We use expect/actual to substitute the player for each platform.
ExoPlayer is a powerful solution for Android with the disk caching and streaming playback capabilities.
AvPlayer is a default solution on iOS.

The basic contract of the player:

@Composable
expect fun VideoPlayer(
modifier: Modifier,
url: String,
volumeEnabled: State<Boolean>,
)

Source link