Hi. If I were to create a library-only project to ...
# android
w
Hi. If I were to create a library-only project to form an SDK. Would it make sense to use Kotlin? Or is it more wise to go with a Java-Only SDK so it easier for people to integrate?
p
weitzj: why is it easier to integrate?
m
There should be no difference in how complex or easy it is to use library written in Kotlin. The biggest disadvantage is you drag #stdlib with you even if your SDK doesn't use anything from it. Sad thing about 1.1 there is some code injected by Kotlin compiler that uses functions from stdlib. In 1.0 stdlib and runtime lib were separate, so you could depend only on the latter and that meant not so many functions were added when depending on it transitively.
Anway, I'm writing SDK in Kotlin and will only release another version in Java if there are a bunch of users who complain.
k
iOS SDKs are done in objective c for that reason
Not all users are on Swift
w
Thank you for your input. Then I might go with Java for now for the SDK.
b
Java is still the way to go for libraries (unfortunately). K
c
I would disagree. I work on an SDK that is 99% Kotlin. It is consumed by primarily Java-based applications.
k
Depends heavily on who the users of the SDK are IMHO. If it's something like a Facebook SDK with a big audience, it matters more that it be raw Java with minimal libraries
q
If you do chose Java and expect Kotlin folks to use your SDK make sure you are annotating your nullable params and return values https://medium.com/square-corner-blog/rolling-out-nullable-42dd823fbd89