Hello,

I built an iOS app (got approved by Apple today) using Swift. The app uses native iOS Swift libraries. What is the best approach to port my app to Android?

  • Pistcow@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 days ago

    I did a VM of Hearthstone from my PC before they had an android app. So uh, do they have a PC version?

  • unknownuserunknownlocation@kbin.earth
    link
    fedilink
    arrow-up
    0
    ·
    7 days ago

    I don’t know what kind of a state your code is in, but if you haven’t done it yet, seperate the code for the app’s logic from the code that interfaces with the iOS APIs as much as possible. The code that handles the logic is the code you’ll be able to reuse (at least I would be surprised if there wouldn’t be a way to compile swift code for Android). Side Bonus: this makes it much easier to write proper tests. Then you can work on adapting the code that uses the iOS APIs to use the Android APIs. Either there’s a direct way to call the APIs from swift, or someone will have made a library somewhere that you can use.

  • okwhateverdude@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 days ago

    Feed it to an LLM and tell it to do the thing. It will suck. It might not even build (be very explicit what version of the android SDK you’re targeting). But at least it will exist and you can always massage it into working order.

    • forrgott@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      7 days ago

      This is an absolutely terrible idea first of all debugging code that you’re completely unfamiliar with is not easier than writing your own. The code you end up with is also likely to end up being very insecure with vulnerabilities exposing both you and your users.

      When people actually crunch the numbers, vibe coding does not save time. So there is nothing to offset the massive drawbacks to this approach.

      • okwhateverdude@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 days ago

        Well, given the level of effort in the OP, I figured this was the best response. If some serious engineer came up to me and told me they wrote a whole app with some platform specific language and now are looking for tips for porting it to some other platform with some other language, I’d laugh. What else can you say other than “Learn the language of that platform and good luck with the rewrite”? You’re barking up my tree when it is OP with the very lazy fucking question.

        • q1p_@lemmy.zipOP
          link
          fedilink
          arrow-up
          0
          ·
          7 days ago

          I originally built the app just for iOS, not really planning to make an Android version. Later, I started thinking it could be worth porting to Android. The app feels totally native, clean design, well-structured code, no bugs so far, everything tested. It looks and works like an Apple pre-installed app (not even joking lol) fast, smooth, and responsive. I’m not trying to sell it or anything, it’s completely free, and I’m genuinely proud of it. Now it’s more about marketing and seeing how it does, but bringing it to Android could open it up to a bigger audience.

        • forrgott@lemmy.zip
          link
          fedilink
          arrow-up
          0
          ·
          7 days ago

          Umm, okay.

          You’re advice was still terrible. And now you’re justifying it by making unkind and equally unfounded assumptions about the OP?

          Whatever, dude.