can I use coroutine in a multi module multi language( kotlin and java ) project app?

453 Views Asked by At

lets say there is an android project with module a, b and c all written in java. then I add another module, module d in the project. can I still use coroutine internally in module d?

I know I cannot use it in java module, but does coroutine still work in this project even though specific module that use coroutine was pure kotlin

1

There are 1 best solutions below

0
On

You can definitely use coroutines in your kotlin class without any problem. The syntax remains the same as any normal kotlin project.

On top of that, you can even use coroutines in your Java Class by a workaround using this.

Implementing Coroutines in Java