News for hackers. Stuff that matters.
Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by hn_throwaway_99 on Sunday November 01, 2020 @10:31AM (#24960094)
> Isn't most non-UI code going to be buried in your server APIs no matter what?

As someone who has had to maintain apps across web, iOS and Android, the answer to that is most definitely no.

Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by tootie on Sunday November 01, 2020 @10:37AM (#24960140)
I don't get it. If you're sharing logic across web and mobile doesn't that demand moving as much work as possible to the server? I've built a plenty of web and mobile apps and that's how I've always done it. Maybe I'm not thinking of the kind of tasks you're talking about. Can you give an example of what kind of process would need to be run on device that's independent of UI?
Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by mdpye on Sunday November 01, 2020 @10:47AM (#24960214)
Giving a good experience with poor connectivity means the clients need to be able to reason about updates to the domain model and potential conflicts. At this point they need to reason about almost as much as the server.

Search for "offline first" to see how people are exploring architectures like this.

Edit: source: I worked on a product bundling chat functionality as a plug in.

In fairness, I think this is not so relevant for apps which are consumption first, but if there's any kind of collaboration, or even just writing from the client, you want to show an optimistic (at least; some systems make the client state canonical) representation regardless of sync status.

Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by filleokus on Sunday November 01, 2020 @11:00AM (#24960317)
Some use cases I think about off the top of my head:

- Data model operations on local copy of data: For some use cases you can't just send everything to the server all the time, instead you want a local representation which is periodically synced with the server

- Logging / monitoring: Expose a single logging / monitoring API which can be shared across platforms

- Input validation / rules engine: Consider implementing a syntax highlighter, you wouldn't want to do that on the backend. Even simple form validation might sometimes be preferable to do client side, calling the multiplatform validate(data_model) and getting per-field validation back would allow for a lot of logic re-use.

- Do work that could be done on the server: Because of a lot of factors, like privacy or cost you might want to do work that could be done on the server. I.e, calling some sensitive third party API (banking?) where you have to transform requests/responses. Or maybe computation on large sets of data (video compression?) which otherwise would need to be sent to the backend.

- Interact with devices only locally accessible: IoT/bluetooth things

Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by setr on Sunday November 01, 2020 @05:32PM (#24963123)
You end up duplicating the logic achieve to offline-first, and reduce network roundtrips. Eg your sign up page final validation is probably the server's job, but if you want to give earlier/faster failure messages, you'll want it on the frontend too.

Server authoratative validation is security; frontend validation is UX

Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by vbezhenar on Sunday November 01, 2020 @12:09PM (#24960844)
If you're moving most of logic to the server, why have an app at all? Just build a website. For me app means offline work.
Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by snappytrap on Sunday November 01, 2020 @07:20PM (#24963776)
Mobile apps often achieve better conversion rates than mobile websites - at least for e-commerce.
Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by fomine3 on Sunday November 01, 2020 @07:33PM (#24963853)
If it's only the reason why build app, it looks like providing WebView wrapper based app is just fine.
Re:Netflix Android and iOS Studio Apps now powered by Kotlin... by bluepizza on Sunday November 01, 2020 @10:50AM (#24960238)
Authentication and identity management comes to mind immediately.

But, of course, there are plenty apps that prefer to do things locally, for so many reasons - if Spotify downloads songs, it does so locally. Or a note taking app such as Evernote needs to capture and compress whatever was drawn on the screen. Not to mention games!

If you think about more than CRUD apps, you’ll see that there are plenty things to be run on the device which are independent of UI.