I come from a bit old school, C world, so excuse the naive question. Is it possible to build both a desktop (Linux/MacOS/Windows) and mobile (tablet and phone, android and IOS) application from same codebase (with slightly different codepaths for UI specifics) with React Native or something similar? I see Xamarin is almost there, but no Linux.
I have a need for an app that is mostly word-processing oriented in nature with some interactive graphing and drawing, some displaying, creating and drawing on top of PDFs too. I'm looking for easiest path to create something crossplatform AND performant (and possibly easy on the battery).
The project I'm currently on involves writing an app that will share most state management/business logic (we're very lightly using/abusing Redux for that part) and a web API client in Javascript (well, Typescript) across phone (iOS, Android), tablet (ditto), and TV (tvOS, Fire-whatever, maybe AndroidTV if that turns out to be easy), using React Native for the UI on everything but tvOS (TVML there).
I also thew the logic/state/HTTPclient part of the app behind a crappy Electron "desktop" UI the other day for giggles. Wasn't hard, took about half a day. No design or releasable GUI in that amount of time, but you can click buttons and fill in values and stuff happens, using the same code as all those other platforms do (or will, in some cases—it's ongoing). So you can't share the GUI, but you can share pretty much everything else.
> (and possibly easy on the battery).
React Native's not too bad, compared to other cross-platform whatevers that have come before it. Electron kind of almost flirts with being easy on the battery at its very best, but hell, no-one else seems to care about that so why should you?
> creating and drawing on top of PDFs too
Oh god. Have fun with Android and PDF. Yeesh.
[EDIT] I should add that you can always add native code to React Native projects for parts that need it. Not sure about Electron, but... maybe?
You can certainly do that for iOS and Android - I've recently launched an application myself which does just that. At least 95% of the code is shared between platforms.
There are some desktop bindings available, but they're relatively experimental:
As a freelance developer at the low end of the market (ie. where most apps and developers live), I can assure you that the logic layer is usually so small that the benefits of making only it cross-platform would be minimal. Most of the code in most of my apps is UI code. RN saves me roughly 80% compared to two entirely separate native codebases. A cross-platform business logic core saves me perhaps 20%.
Sure, I agree for a greenfield social/mobile/local mobile app, RN makes a lot of sense.
> both a desktop (Linux/MacOS/Windows) and mobile (tablet and phone, android and IOS) application from same codebase... word-processing oriented in nature with some interactive graphing and drawing, some displaying, creating and drawing on top of PDFs
... definitely doesn't fit that description. At that point, your choices are JS with RN, React and Electron or C++. For custom graphics rendering and editing, JS would be a very odd choice.
C, that is more C++ kind of is my choice (QT namely). I was wondering if there is a faster approach with JS, since I don't care about what I work with in this case, as long as it doesn't take me much time to do it. Xamarin seemed like a good direction, but no linux yet. Electron, while heavy, seemed like almost a perfect choice - but no mobile.
I have a need for an app that is mostly word-processing oriented in nature with some interactive graphing and drawing, some displaying, creating and drawing on top of PDFs too. I'm looking for easiest path to create something crossplatform AND performant (and possibly easy on the battery).