Christopher Elías

    Christopher Elías

    2 years ago
    Hello 👋! Can I start a Kotlin MMP for Android & iOS with Android Studio on Windows? Does anybody have some samples on how to prepare the environment and "hello world sample" maybe?
    s

    Sam

    2 years ago
    The only problem you’ll have is working with iOS specific code as that requires a Mac. Anything that is Android or common code should be fine.
    Christopher Elías

    Christopher Elías

    2 years ago
    Thanks for the reply Sam. So limitating and frustrating btw. So the only option is to get a Mac for anybody who want to develop native apps with shared common code
    j

    James Palawaga

    2 years ago
    You can develop native apps with shared common code (Windows Native, JVM, even iOS) but you will not be able to compile iOS/mac targets without a mac
    so if you write a KN/MPP app, it could potentially have a valid iOS target, you just have no way of actually compiling it without a mac (it’s an apple thing rather than a kotlin thing)
    Christopher Elías

    Christopher Elías

    2 years ago
    Thanks James! Very clear response. I have some doubts as I am literally new into Multiplatform and you seem to have experience with it, which IDE do you use for it or probably do you have to work with multiple IDEs at the time (for android (A.S), ios (XCode) and common (Intelli J)? How does that work?
    j

    James Palawaga

    2 years ago
    I actually work mostly on a shared KN library used by our platforms, so I do all of my development in Intellij as I’m only writing kotlin with no platforms. If I’m testing our library in a particular platform app, then I use the individual platform’s toolchains to build the app with our MPP lib (Android->AS, iOS->XCode, VS->Windows).
    I think a good starting point would be to make a simple
    returnHello()
    function in a KN library. and work on your gradle scripts to build the package for each platform. Then for each platform, work on consuming that
    returnHello()
    function. For JVM for example, you might want to means publishing your package to a local maven repo, or at the minimum publish the jar to a known location
    At least, this is how we use KN. I’m not sure about, say, using react native to make up the UI, and then publishing an app entirely from KN. I suspect you’ll still need to use each platform’s build toolchains (XCode, AS, VS) at the minimum to bootstrap your KN project, but this is out of my area of expertise.
    Christopher Elías

    Christopher Elías

    2 years ago
    Thanks for your help James! I will continue the investigation and see how far can I go with it on my laptop (Windows OS).
    a

    Andrew

    2 years ago
    What is your android experience at the moment?
    Christopher Elías

    Christopher Elías

    2 years ago
    3-5 years... why?
    a

    Andrew

    2 years ago
    KMP is mostly about code sharing, so the best you can do without a mac is move as much code in an existing android app to a shared KMP library. It will require some re-architecture and some less than ideal design decisions than if it was a 100% android app. That is about as close as you can get to the multiplatform part without having access to the other platform.
    Christopher Elías

    Christopher Elías

    2 years ago
    Thanks, I will have in mind that advice!