https://kotlinlang.org logo
#android
Title
# android
w

weitzj

06/02/2017, 9:55 AM
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

Paul Woitaschek

06/02/2017, 10:23 AM
weitzj: why is it easier to integrate?
m

mg6maciej

06/02/2017, 10:29 AM
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

kenkyee

06/02/2017, 11:01 AM
iOS SDKs are done in objective c for that reason
Not all users are on Swift
w

weitzj

06/02/2017, 11:24 AM
Thank you for your input. Then I might go with Java for now for the SDK.
b

bachhuberdesign

06/02/2017, 2:36 PM
Java is still the way to go for libraries (unfortunately). K
c

codeprogression

06/02/2017, 4:29 PM
I would disagree. I work on an SDK that is 99% Kotlin. It is consumed by primarily Java-based applications.
k

kenkyee

06/02/2017, 7:51 PM
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

quinnjn

06/02/2017, 8:37 PM
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
3 Views