Writing code for multi-platform

Hi!

I’m writing a small app, and i want to compile for mac, win and linux.
No secret, at all.

But i also want to compile to iOS and Android.

What’s the best/correct way to do this smoothly?

And, of course this is not the place to ask, but what other IDE could i use to do just ONE code to built for all platforms above?

Best regards,

Alex

Google?

For all the help you have received here and now ask this?

1 Like

Xojo can get you most of the way there if you are careful in how you structure your app. But you’ll need separate projects for mobile vs desktop that share code between them. This probably isn’t for a Xojo beginner.

Other than that - no idea. A web app can do that, of course.

a good start :

It’s amazing how there are rude people who get bothered by pertinent issues.

Doing 3 projects is certainly much more laborious and costly than doing just one…

This doesn’t mean changing platforms, even because there’s a whole learning and adaptation period. It’s probably more laborious than writing 3 projects “of the same project”

And if you’re bothered, it’s simple: don’t respond.

Right?

“All the help I’ve received here”? People help because they want to. And I’m very grateful, even though sometimes I don’t have time to test the suggestions, and even forget to say thank you.

After all, I’m human.

3 Likes

Yes, it’s an option I had thought about.

But my idea is to sell on platforms, I don’t know if making the web version would be the best choice.

thanks, I’ll take a look

@Alexandre_Cunha
Excuse you if you are calling me rude
Rude is asking for help here over and over and having kind people helping and then asking for help to find alternative IDE

I have more then 3 projects with Xojo and never asked for alternative IDE

Yes people help because they want to, but do not take advantage of them.

Well, I have better things to do than argue.

Once again, and for the last time, if you were bothered by my post, don’t participate.

Years ago (back in the RealBASIC days) I developed a program to convert VisualBasic to RealBASIC. Obviously, there was a lot of manual work involved, but most of it was done automatically.

Maybe someone knows of an app that does something similar… that helps convert desktop apps to iOS or Android…

You won’t find one in that direction - the user interface paradigms are just too different. Apple does have their Catalyst scheme that lets you run iOS apps on Mac desktops but it’s not great; UI bugs and misfeatures abound.

1 Like

FWIW, if you do find a product that promises cross-platform to everywhere, the end user experience is probably going to suck. Most desktop setups are presented in landscape (horizontal) and expected to work on monitors of 14" or larger and operated with a mouse and keyboard. A typical phone is portrait (vertical) and 4" to 7" and operated by fingers. Heck, except for a few larger tablets, most of them are under 10".

What I’m getting at is that each platform is going to have strengths and weaknesses and your users will expect you to make an app that feels native to them on that platform.

5 Likes

So true.

  1. On desktop I open a new window for each new function and usually stretch the content to fill the width.
  2. On Web I open a new window for each new function and it replaces any existing window, so I have to keep track of any unsaved edits, plus I need to limit the width of edited content to ~900 pixels otherwise it looks unprofessional.
  3. On Mobile I open a new window for each new function that replaces any existing window, plus I need to move all labels and fields under one another to scroll vertically on an iPhone.

The tools that provide one-size-fits-all solutions often look like web apps running on a desktop or mobile, but this might be acceptable for your need.

Flutter

Something got confused (me) and I deleted my post.
What I meant to say …

Alexandre - you can’t get there from here (an old skit where a city fella asks for directions from an old-timer) unless your “project” is very restricted. Why? because each platform has features not shared by the others. If you employ one of those unique features for one language, it won’t run when compiled for another.

For example - and there’s no crime in mentioning another platform - I can use SimplyFortran on my Mac or PC. But the PC version can make use of extensions that allow a graphical interface. If I put in code to take advantage of that interface ability, I can’t compile to code to run on the Mac. I’m not even sure I could “jump around” the PC specific code if “IF” statements.

There’s a reason Apple has an OS for Mac and an iOS for iPad and iPhone. As long as there are different operating systems, you’ll have a narrow path to walk as far as what coding statements are acknowledged by all.

Xojo is wonderful in that you have one application that can be used to compile code for all those platforms: Mac, iOS, Windows, Linux, Web … But, in addition to a narrow path of commonality, each has its own specific features; features not duplicated in the others. It’s just the way of the world right now.

Its like saying, I like the way that girl looks. I like the personality of this other girl. I like this third girls sense of humor (and on and on past the TOS :grinning_face:). How can I combine them all in one person?

ok guys… i got it

1 project = 3 projects…

rsrsrs

thank you all

Honestly… pick another language. To do it with Xojo means 3 projects with 3 distinct sets of code, none of which have feature parity with each other. Even if you did desktop in Xojo and mobile in something else, you will have still reduced the number of projects.

I’ll just note that Xojo will let you easily share the business logic between the projects. It’s the platform-specific UI stuff that creates the multiple projects. I’m not sure that there’s any other tool/language/stack/whatever that will do it much better without severe compromises in the UI.

2 Likes

That’s a half-truth. Xojo only lets you share logic if you’re not using the version control format, which every project should be using.

But it’s also the fact that Xojo targets all these different platforms. You couldn’t share logic built in, say, PHP, between web and desktop platforms. There just aren’t a ton of well-developed toolsets that have this reach – offhand, I can imagine most tools could target desktop and mobile but wouldn’t hit the web, or you might make a web app and encapsulate it into a mobile app but ain’t nobody who wants that crud on the desktop…