I searched a bit and found one post from back in 2016. I am curious how people are targeting an app for Mobile (iOS, Android), and Desktop from a shared code base?
I know about the if targetOS stuff in code. But the IDE itself seems to force you to choose desktop, web, mobile at the time a project is created.
I am considering the creation of an app that would run on mobile devices and desktop. Maybe web but not sure about that yet. As an app that would talk over the LAN to a device there would definitely be some shared code between the platforms.
Thanks in advance.
This is all I do now (Desktop, Web and iOS with 99% shared code).
I did a talk on it at an MBS Conference (https://www.youtube.com/watch?v=JSpsJH-owuI). Plus I provided a sample Desktop/Web/Mobile app using this technique (https://www.youtube.com/watch?v=p-LNcGZAKY4) that let users get HTML to PDF capabilities everywhere via a URLConnection to a RESTful server.
I can’t support Android until it gets Xojo Libraries with support from MBS and Einhugur, plus access to the GraffitiSuite classes.
Xojo has a feature called “external items” that lets you share code between projects, even if they aren’t targeting the same platform. Essentially, code is kept in an independent file, and imported into multiple projects.
A full discussion is too long for a simple reply, so I suggest you read up on this feature elsewhere. It is both extremely powerful and potentially confusing and counterproductive. 