Reputation: 13
I created a new app on android studio 4.1.1 and put some libraries from androidx. Some of these libraries have a new version that uses the Kotlin language. For example, androidx.navigation:navigation-ui:2.3.2
has a new version with kotlin.
Is it problem (or a good practice) to mix Java and Kotlin libraries in the same project?
Upvotes: 0
Views: 184
Reputation: 20147
There should be no issue mixing Java and Kotlin libraries: Kotlin has excellent interoperability with Java code.
Adding Kotlin libraries to a project will increase your binary size somewhat by including the Kotlin standard library, so you should make sure to shrink your code (which you should be doing regardless of whether you use Kotlin) to minimize the impact on binary size.
Upvotes: 1