Firebase /w Kotlin-Native

126 views
Skip to first unread message

Ana Redmond

unread,
Jul 11, 2018, 10:39:41 PM7/11/18
to Firebase Google Group

I am converting an Android app to cross-platform by building it in Kotlin. About 80% of the existing code and logic is reusable by compiling it using Kotlin-Native for iOS as well. I am next trying to figure out how to convert the Firebase database and authentication portion. I would like to write the code once in Kotlin and reuse within iOS and Android projects. Is there a Kotlin-Native library available or planned for Firebase?

Ian Barber

unread,
Jul 12, 2018, 12:06:27 PM7/12/18
to Firebase Google Group
No plans for kotlin-native, but that is an interesting project! There is a C++ SDK https://firebase.google.com/docs/cpp/setup which might be helpful in making a single codebase. 

On Wed, Jul 11, 2018 at 7:39 PM Ana Redmond <a...@infinut.com> wrote:

I am converting an Android app to cross-platform by building it in Kotlin. About 80% of the existing code and logic is reusable by compiling it using Kotlin-Native for iOS as well. I am next trying to figure out how to convert the Firebase database and authentication portion. I would like to write the code once in Kotlin and reuse within iOS and Android projects. Is there a Kotlin-Native library available or planned for Firebase?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/6946ea4b-8373-4721-8fad-d3ae8b16db4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ana Redmond

unread,
Jul 12, 2018, 2:25:28 PM7/12/18
to fireba...@googlegroups.com
Yeah! Its a crazy project. I am pleasantly surprised by what's possible with Kotlin-Native. 

Here's what I have so far on the feasibility of single codebase for the Firebase part: 

As you mentioned, I will take a look at the CPP implementation. My C++ is a bit rusty: 20 years rusty.  I am invoking objective-C using Konan on iOS, so, that may be possible for it. But, Konan is not for Android, so, I would have to write separate implementation for Android anyway (which already exists). So, better to just write in swift (which is easier and similar to Kotlin) and make it platform specific library.

The other possibility is using the Rest API for Firebase: Someone said on Kotlin-Native slack that: "Other important JetBrains-provided libraries, like kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client are getting experimental Kotlin/Native support, which means it is possible to write an iOS app and Android application sharing the same REST API-related logic." I will keep an eye on a sample for REST api from Kotlin-Native. 

Still, be nice if Firebase itself built and supported a cross-platform version: now or in a couple of months.

Thanks
-Ana

On Thu, Jul 12, 2018 at 9:05 AM, 'Ian Barber' via Firebase Google Group <fireba...@googlegroups.com> wrote:
No plans for kotlin-native, but that is an interesting project! There is a C++ SDK https://firebase.google.com/docs/cpp/setup which might be helpful in making a single codebase. 

On Wed, Jul 11, 2018 at 7:39 PM Ana Redmond <a...@infinut.com> wrote:

I am converting an Android app to cross-platform by building it in Kotlin. About 80% of the existing code and logic is reusable by compiling it using Kotlin-Native for iOS as well. I am next trying to figure out how to convert the Firebase database and authentication portion. I would like to write the code once in Kotlin and reuse within iOS and Android projects. Is there a Kotlin-Native library available or planned for Firebase?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/6946ea4b-8373-4721-8fad-d3ae8b16db4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/2x2k9rCVnmo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages