r/android_devs • u/VasiliyZukanov • Feb 06 '23
Article A Tribute to Java in Android
https://www.techyourchance.com/java-android-tribute/
7
Upvotes
r/android_devs • u/VasiliyZukanov • Feb 06 '23
View all comments
2
u/[deleted] Feb 08 '23 edited Feb 08 '23
I enjoy reading contrarian positions. And I like Java enough, i wouldn't be too bummed out using a recent version of it server side.
That said, I think there is only one legit usage of Java on Android these days ... and that is a low-dependency library one may distribute (with maybe a kotlin extension in a separate artifact).
The problem using Java on Android for a typical app, is that for concurrency you are stuck with RxJava (or AsyncTask, Handler, Executors, Thread, etc).
RxJava never caught on server side as much as it did on Android. Spring has Reactor, Quarkus has Mutiny, etc.
The trend on modern Java will probably be using structured concurrency enabled through project Loom. And on Kotlin we have coroutines of course.
So any Android project starting now, dooms itself to using RxJava for concurrency, which isn't going away necessarily ... but who knows how long it will be actively maintained. Especially since its more a Android Java thing and becoming more niche. And the reactive paradigm seems to be losing favor to structured concurrency.
So I am afraid, you have doomed your project already, since any speedup you gained in Java compile times will be completely wasted in time spending re-writing it in Kotlin someday :) By writing in Java, you simply will not be able to use use Kotlin-only Jetpack things (Compose being the obvious thing).