Live data from Hacker News

The not so hidden cost of sharing code between iOS and Android

blogs.dropbox.com

211–220 of 335 posts

Re: The not so hidden cost of sharing code between iOS and Android

#211
post #204

Earlier quoted context omitted.

I had the opposite experience with Flutter personally, the problem is that Dart is a niche language with limited exposure (Flutter is basically the only big project in Dart realistically) and it's also a new project as well, it makes a bad combination.

Could you describe your experience more in details? What exactly didn't work out? I would like to know to understand whether it makes sense for me to invest my time in Flutter/Dart instead of a more mature solution like React Native.

Actually, I don't think we should consider React Native more mature. It's been around for longer sure, but it's significantly more fragile, keeps releasing with regressions, has poor tooling around it except for as far as React is concerned etc.

I don't know what you are trying to build on mobile but I'd definitely learn Flutter instead of RN, which I have. Others here have said you should just go full native instead, and they're probably right.

Re: The not so hidden cost of sharing code between iOS and Android

#212
post #174
post #88

Earlier quoted context omitted.

The article says it all - they chose the wrong language with no community support for the trail they were blazing and that technical debt destroyed their productivity. I achieved 90+% code share in Xamarin including UI across windows - ios - andriod. 100% buisness logic shared. You can write cross-platform UIs, and swap out to native code on a widget by widget basis. Threading is seemless. Sure it has its own set of…

I took a look at Xamarin recently to see how far it had come, and the tooling is really impressive. They seem to do a great job of keeping up to date with iOS/Android SDK changes, too. But when trying to find an example of a native-feeling Xamarin-based app for iOS, I was really underwhelmed. I tried to find one that was (a) well-known and (b) third-party (not developed by Xamarin or Microsoft). The 4 contenders were…

I think there is a little bit of bias here. Companies that are prioritize look and feel over cost probably are going native. And companies that prioritize cost over look feel are free are going xamarin.

Re: The not so hidden cost of sharing code between iOS and Android

#213

It baffles me that people think duplicating application code for every device is the way to go. Cross platform can be done correctly. I'm working on a stack that can natively target Windows, Mac, Linux, Android, iOS, MacOS, and Web. I couldn't imagine duplicating my code for each one of these devices. If something special needs to be done, I write an extension. I have a feeling posts like these get upvoted because de…

There's a lot of valid points from native advocates though. Like differences in touch features, various sensor APIs, Firebase etc. These may not be serious considerations in simple apps but they make major difference to both the end user as well as the codebase/developer in larger scale / more serious apps.

That said, myself I still write Flutter too, having jumped ship from React Native.

Re: The not so hidden cost of sharing code between iOS and Android

#214

Hasn't Microsoft successfully written their mobile Office apps in C++ in a single codebase?

Indeed they have. What’s missing in some of the discussion here is the size of the application. For large applications like Office, a shared code base is often the correct strategy.

I work on Office and am glad someone brought up this point. Writing a C++ business logic layer is probably too much for a simple CRUD style app, but the equation changes once the view/platform layers are a tiny minority of the logic in your app.

Re: The not so hidden cost of sharing code between iOS and Android

#215
I worked in a company that makes games for both ios and android and it shares majority of the code in between. It was using libgdx which uses Java & opengl and it was working very well for us.

I would say things are not so bad when you pick your tools right.

Re: The not so hidden cost of sharing code between iOS and Android

#216

I worked in a company that makes games for both ios and android and it shares majority of the code in between. It was using libgdx which uses Java & opengl and it was working very well for us. I would say things are not so bad when you pick your tools right.

I think the use case Dropbox has is quite different, because they have a lot of native code surface, needing lots of interactions with the shared code base. A game can get by with only a few lines of native code, AFAIK.

Re: The not so hidden cost of sharing code between iOS and Android

#217
post #208

Does anyone have experience trying to do this kind of thing with LibGDX? LibGDX is a layer on top of OpenGL (lwjgl actually), and used a lot for game development. It is based on Java, and is able to package the application for Android, iOS, Windows, Linux, Mac, and even web (targeting WebGL). For iOS it uses RoboVM, and for the web export it uses GWT to compile to JavaScript. Obviously this is best suited for custom…

Actually flutter is based on this approach. The native widgets are completely recreated with this dart based runtime. Performance is indeed great, however it seems like a hell lot of work to create all these widgets...

Re: The not so hidden cost of sharing code between iOS and Android

#218

We've had a mostly different (positive) experience doing a similar thing at FullStory for mobile instrumentation, though I think I know where some of the key differences are. Our core "business logic" lives in Rust. This is a shared bit of code between Android & iOS that mainly deals with orchestration, serialization, and server communication. We managed to extract ~1/2 of each platform's native code into this shared…

Kotlin Native comes to mind - it generates binaries that can easily integrated with gradle and cocoapods, complete with headers/interfaces.

Do you also keep ViewModels or things like an AuthManager (incl Keychain) or view coordinators in Rust?

Re: The not so hidden cost of sharing code between iOS and Android

#219

Add more fuel to the "write once, run anywhere" dumpster fire. Let's peek in there - I see C, C++, Java, JavaScript, stored procedures, wxWidgets, RubyMotion, GTK, QT, object oriented programming, functional programming, PhoneGap, React Native, Flutter, ... It is getting full in there. What's that about the definition of insanity? Doing the same thing over and over and expecting a different result? Sever side rendere…

I'm using Flutter successfully. It has the potential to become a really great platform. Java is a good language, as long as you rarely use implementation inheritance. I would not recommend using React Native or C++ for any project.

The flutter approach is interesting, however i tried really hard to become friend with dart, which seems impossible to me... I only hope somebody is building a transpiler or something.

Re: The not so hidden cost of sharing code between iOS and Android

#220
post #182

Earlier quoted context omitted.

I'm using Flutter successfully. It has the potential to become a really great platform. Java is a good language, as long as you rarely use implementation inheritance. I would not recommend using React Native or C++ for any project.

React Native - JavaScript, plenty of jobs outside mobile dev. C++, plenty of jobs outside mobile dev, and a very nice pay to come along. Flutter - Dart, death silence outside Flutter use cases.

I like doing projects with ionic, which have the great advantage to be ported to the web and also packaged as desktop apps. From all the apps i have developed with web tech or even i know of no users are complaining about lower performance or similar. Why developers have this opinion?
Post reply on HN