Is Kotlin as well supported as Java, for downstream users?

Viewed 101

I am deciding whether to use Kotlin or Java for an SDK project, and have some questions, all relating to downstream use of the SDK:

  1. If I use Kotlin to build the SDK, will downstream users be able to use the resulting AAR in a Java-based project?
  2. If I use Kotlin, will it affect what versions of Android the users of my AAR can target, compared to the equivalent Java code?
  3. If I use Kotlin, will developers using older development environments (e.g. old versions of Android Studio) be forced to upgrade in order to build a project using my AAR?
  4. Are there any other considerations that I may not have thought of which might prevent downstream users from being able to use my AAR if Kotlin is used, rather than Java?

Background

We are about to embark on building an Android SDK to enable third-parties to interface with our project.

The consumable end result will be an AAR for third-party users to add into their projects. This will provide both user-visible interfaces and developer APIs. Developers can instantiate the UI class and have it do all the work for them (including user interactions) or they can use the developer API classes to build their own front-end from scratch.

We want our SDK to be as widely usable as possible, both in terms of supported Android versions/platforms and in terms of developer environments.

Would we limit our reach if we decided to develop the library using Kotlin, as opposed to Java, or are they fully interchangeable? I am not clear about what dependencies Kotlin places on other developers (in terms of tool-chain) or on deployments (in terms of Android version support) and whilst there are lots of feature comparisons between the two languages, I haven't found anywhere that provides this kind of compatibility comparison.


UPDATE: This question indicates that there is no difference between them in terms of which Android API levels (i.e. which devices) they support. Assuming this is the only consideration for Android compatibility, this seems like it answers question #2.

0 Answers
Related