Settings

Theme

Ask HN: What to use to build an iOS and Android app?

6 points by santy-gegen 2 years ago · 14 comments · 1 min read


Hey guys,

I've got this project I'd like to turn into a mobile app that runs on ios and android.

What are my alternatives? I'm well versed on react and planning to use react-native. My question is probably more about React Native CLI v Expo.

Any info is welcome! Thanks!

mightykip 2 years ago

I haven't used React Native so I can't speak to that... but... Flutter is awesome!

I have used Flutter to build an App which I distribute on iOS, Android, Web and MacOS using the same code. It is fantastic.

Here are some of Flutters advantages.

* Performance: Flutter's architecture, using its own rendering engine (Skia), leads to smoother, faster performance compared to React Native's reliance on native bridges.

* Single Codebase: Flutter promotes a "write once, run anywhere" philosophy. You can build native-like apps for iOS, Android, web, and even desktop with the same codebase. This significantly reduces development time and effort.

* UI Development: Flutter's declarative UI approach (building UIs with widgets) and its rich set of built-in widgets make it incredibly powerful for creating visually appealing and complex UIs.

* Hot Reload: Flutter's hot reload feature allows for rapid development and iteration. Changes you make in your code are reflected instantly in the app, making development faster and more efficient.

* Great for Custom UI: Flutter is a good choice for apps requiring a high level of customization, unique animations, and complex UI designs.

muzani 2 years ago

Just use what you know. React Native is not bad.

If you have a large budget and want to go for the long term, I'd say go for native Android and iOS. You'll eventually get all kinds of weird bugs. Like this morning, I was looking at a bug with thousands of crashes on a very specific model of Vivo phone (involving 5 users); turns out it was from a way that Android does encryption and handles backups.

The more layers of abstraction you have, the longer it takes to find and fix those kinds of bugs. Take note that Android is extremely fragmented and customized, especially in developing countries if that's your target market.

Most of the bugs we deal with today are are 1) camera 2) file storage 3) locale (language, RTL, how numbers and currency are displayed). I haven't worked with Bluetooth, but I expect that to be major too.

PWAs are a solution if you're basically just making a mobile site and don't need the above.

Flutter is mature enough that most of the layers are running well. A lot of the cutting edge tech goes to Flutter, and I'd recommend it as the default. Half our native team are Flutter fanboys and I'm guessing there's a very good reason for that.

Someone proposed KMP before. We gave it a shot and canceled it because it felt horribly unoptimized. This is just anecdote, though.

I haven't used React Native and don't plan to, but my main worry is the number of layers and the people maintaining them. Mobile has a lot of breaking changes since Android 10 (2019). iOS's support window is probably 3 years. I don't know if we can extrapolate this to the following years, but Android 14 has had a major breaking bug that wasn't backwards compatible.

If the layers are not being maintained, you end up with a mess like Cordova. We migrated to native after running the numbers and realizing that it's cheaper to hire 1 senior iOS and Android person rather than hire a single mobile person and a bunch of contractors to update plugins each time. Both platforms are also different in some ways. Code complexity increases exponentially, and `if (iOS)` logic will contribute to this by a lot. One code two platforms is not always a good thing in the long run.

But if you want that, then Flutter is built for it.

  • santy-gegenOP 2 years ago

    ok, very thoughtful response, thanks so much!!

    the app doesn't need extremely complex modules, it's crud with some extra steps. most of the magic is on the backend.

    i'll take a look at flutter before deciding what to do.

meiraleal 2 years ago

Why not PWAs?

https://docs.pwabuilder.com/#/builder/app-store

  • santy-gegenOP 2 years ago

    users constantly ask for a native app!

    • meiraleal 2 years ago

      Do they? I don't remember asking no crud app to be native. We are also using web apps on Android and iPhone without complaints.

jjaison13 2 years ago

flutter or react native are probably the best options

mrKola 2 years ago

Compose multiplatform

millsteed 2 years ago

Have a look at Flutter.

  • bindd 2 years ago

    I would second the recommendation of Flutter which I have used - and liked - in the past.

    You can't go wrong with it!:)

  • santy-gegenOP 2 years ago

    Will do! Where do you think it shines as compared to react native?

    • wismwasm 2 years ago

      I personally haven’t used react native but what I like about Flutter:

      - Comes with a decent component library out of the box that’s easy to customise

      - Dart is a nice language overall, null save and typed

      - As it paints on the screen there’s no need to write any UI layer more than once for different platforms

      - Good development experience with VS Code

      - JS interop in case you need to use JS libraries

      I just really like to avoid CSS though and flutter offers that. Having pre styled widgets with documented styling parameters as arguments is great.

      https://dartpad.dev/?sample=counter

      • santy-gegenOP 2 years ago

        wow, this is incredibly useful information! thank you so much. i didn't know flutter offered so much

        • wismwasm 2 years ago

          It may also look a bit boilerplate heavy but with the VS Code add in and code snippets it’s actually quite ergonomic to write. Just don’t attempt to type it all out by hand.

          If you decide to give it a try there are some packages I’d recommend:

          - Follow the official getting started: https://docs.flutter.dev/get-started/install

          - State management: https://riverpod.dev/ is easy enough and quite powerful. The official docs still recommend Provider, but that’s basically deprecated. Riverpod is an improved Provider by the same maintainer

          - Go router https://pub.dev/packages/go_router is the standard for routing

          - I used sqflite for persisting local state: https://pub.dev/packages/sqflite

          The setup may of your dev environment may take a bit (the mobile SDKs are quite big to download) but after that it’s quite smooth.

          Flutter is “inspired” by react so you should feel familiar with the widget lifecycle. Unlike modern react though it uses class based components and when using stateful widgets (components) it’s split into two separate widgets.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection