Click here to Skip to main content
15,031,368 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
I wanna create a high performance app once and run on:

- Windows desktop
- Linux
- Mac OS
- iOS
- Android

I don't wanna change code for each of the platforms separately.
I wanna write once and run on all of them.
It may be framework based or compiled into native machine code for platforms separately.
Performance is important.

Is it possible?
If it is not possible, let me know and i terminate my search.

I write questions very brief and simple to make it easy to understand and my last question was closed as not plain to answer, so let me know what is wrong and i improve the question.

I know C# and i know about Xamarin, but Xamarin shares code across, it is not one code running across, so it is not what i want.
Posted
Updated 14-Apr-15 3:51am
v5
Comments
Leo Chapiro 14-Apr-15 9:39am
   
Just for understanding: Windows in your list should be "Windows Mobile", right? What is Linux and MacOS, what is here a difference to Android / iOS?
Ziya1995 14-Apr-15 9:45am
   
> should be "Windows Mobile", right?
No, it is Windows like Windows 7 or 8.1.

> what is here a difference to Android / iOS?
I want my app support Windows desktop, Android, iOS because i will get more money, it is also would be pretty cool if they do support Windows Store, Play Store, App Store.

Right now i am a bit confused because of the 2 major things:
Web based cross platform technologies are slow, i don't want HTML/CSS/Javascript - just exclude it.
Others confuse me, because i don't know they share code or it is completely write once run anywhere.

For example, i downloaded Xamarin and it turned out i can't share GUI, i need to write GUI separately for all 3 platforms - i don't want it.

I don't now, but if you know whether it is possible or the max level way is to share code and normalize it separately for different platforms - let me know)
Leo Chapiro 14-Apr-15 10:02am
   
It depends on what programming language you can. Take a look: https://www.backblaze.com/blog/10-rules-for-how-to-write-cross-platform-code
Ziya1995 14-Apr-15 10:07am
   
Can you say is it possible to write once a simple GUI app and run across said platforms?
Or do i always need to change code to fit platforms separately?
Leo Chapiro 14-Apr-15 10:17am
   
For the simple GUI app you can use the web based technologies, with HTML/JavaScript it should be possible.
If you in contrast need the good/best performance, you'll need to use specific technologies: ObjectiveC for iOS, C# for Windows and Java for Android. Xamarian can help to avoid ObjectiveC by using C# only, but that's!
Ziya1995 14-Apr-15 10:36am
   
> but that's!
it would be cool if you answer my question:
Can i write high performance app once (not WEB) and compile it into native code for different platforms?
Xamarin shares code, it doesn't run the same code on different platforms.
Can you answer?

For example, i read about Adobe Air and it says it is cross platforms, but i can't understand what it means - sharing code?
Richard MacCutchan 14-Apr-15 10:44am
   
The short answer is: no, you cannot do it. You could try Java, but even that is not guaranteed to run unchanged on each platform (and is not really high-performance). Better that you define your requirements and figure out which parts you can make common, and which need to be platform specific.
super 14-Apr-15 10:46am
   
You really need to understand that one same code for all platform means its no good in any one based on performance. If you want your apps to work in the best way in particular platform, then you need to cater to that target. Otherwise you will have very bloated apps which is medium at best in all platform.
Ziya1995 14-Apr-15 11:23am
   
Wait, there are so many technologies, for example Adobe AIR.
It says it is cross platform, i understand it as you can write once and run anywhere with Adobe Runtime.
There are also C++ QT and Unity3D.

All of that means you can write once and run on all said platforms without normalizing code for a specific platform.
And Unity3D has high performance.

You say no, but C++ QT, Unity3D, Adobe Air are saying conversely or i don't understand something?

What is wrong?
Richard MacCutchan 14-Apr-15 11:39am
   
The only way to be sure is to try it for yourself and see what results you get. But don't be surprised if it does not work as well as these organisations claim.
Ziya1995 14-Apr-15 11:50am
   
> if it does not work as well as these organisations claim.
You mean it doesn't work?
Right now i am stuck between .Net WPF and Adobe AIR.
Richard MacCutchan 14-Apr-15 11:56am
   
No, I mean there is only one way to be sure, and that is to try it. No one can predict whether your code will work or not.
Ziya1995 14-Apr-15 11:58am
   
Many people tried it until me and i just can't check it on all platforms in a few days.

If you know, say me what do you think, does it work normally or makes many bugs? I have just read it doesn't work normally, is it true?
Say me what you think, i would get any information about it now.
Richard MacCutchan 14-Apr-15 12:17pm
   
At the risk of boring you I will say again: no one can predict whether your program will work on all platforms. The only way to find out is to try it.
Ziya1995 14-Apr-15 12:33pm
   
I get it as you mean it is not guaranteed it will work, so there were cases when it did not.
Ok.
Richard MacCutchan 14-Apr-15 13:11pm
   
No, no, no!
It is impossible to guarantee that it will work, any more than you can guarantee that any single platform program will work.

You cannot know that a program will work until you try to run it. Even when you have compiled it with no errors or warnings, it may still fail when it is run.

If you really do not understand this simple fact then you are going to have a lot of difficulties as a developer.
Ziya1995 14-Apr-15 14:34pm
   
There are so many cross platforms APIs, but you say it is impossible or bad, i don't understand, i am very confused.
Richard MacCutchan 15-Apr-15 2:56am
   
You are confused about what? The answer, as I have said repeatedly, is quite simple: it is impossible to be sure that a cross-platform build will work until you try it. That is the only way to be sure, and much will depend on the features that your application uses.
Ziya1995 14-Apr-15 14:25pm
   
> its no good in any one based on performance.
Same C++ QT code is compiled into native code for all listed platforms - what performance issue might be when it is native?
Richard MacCutchan 15-Apr-15 2:58am
   
Please see my answers above: no one can predict what performance issues you may face. The only way to find out is to try it.

1 solution

Wrong question. There is no such thing as "best". How would you define the predicate "better"? If you can, please share with us. Also, the question is too vague; there are too many different approaches having certain benefits depending on a big number of factors.

So, I'll just mentioned two most widely used options which are 1) not scripting, but based on compilation, 2) won't require recompilation on different platforms. They are: Java (JVM) and CLR (.NET and other implementations). Please see:

http://en.wikipedia.org/wiki/Java_(programming_language)[^],
http://en.wikipedia.org/wiki/Java_virtual_machine[^].

And
http://en.wikipedia.org/wiki/Common_Language_Runtime[^],
http://en.wikipedia.org/wiki/.NET_Framework[^],
http://en.wikipedia.org/wiki/Mono_%28software%29[^].

Common topic for then: http://en.wikipedia.org/wiki/Just-in-time_compilation[^].

[EDIT]

On other approaches (some of them have been mentioned by other members, please see my past answer:
writing c/c++ visual programs (cross-platform) with which IDE and compiler?[^],
http://www.codeproject.com/Answers/258139/Visual-Studio-Application-for-Target-OS-Windows-an#answer1[^],
How to Compile Visual studio C++ to linux and os-mac[^],
What`s the Problem with this Plot Program win32[^].

I would not consider anything by Adobe as anything serious, but this is up to you to decide.

—SA
   
v2
Comments
Ziya1995 14-Apr-15 12:12pm
   
None of said by you support all said platforms at the same time.
So, your answer is wrong.

> So, I'll just mentioned two most widely used options which are
I know all of that, i asked a specific question, but you can also describe lots of other ways that do not support platforms listed in the question.

Adobe AIR is write once and run on all said platforms in exception of Linux and that is great and i wanna know is it true? I heard it doesn't work normally, makes bugs and so on, can you explain? I would happy happy)
Sergey Alexandrovich Kryukov 14-Apr-15 12:36pm
   
I don't even understand what you are talking about...
It's not my fault that you "know all that"; you never indicated what you know and what not. You did not say a single word against my statements themselves.
And what you say about Xamarin is gibberish.
Adobe... Everything created by Adobe is proprietary and, in certain sense, low-quality. I recently got rid of the last Adobe product and want to stay away from it...
—SA
Ziya1995 14-Apr-15 13:11pm
   
I wanna create a high performance app once and run on:

- Windows desktop
- Linux
- Mac OS
- iOS
- Android

You advice Java and .Net:
Java support:
Widnows
Linux
Mac OS

.Net Support:
Windows

> It's not my fault that you "know all that"; you never indicated what you know and what not.
I am a friend, not enemy, we should not show what we know and what we don't know, because we know so many things) and to make question easy to get, i make it specific by asking what cross platform way, framework is the best or at least in the top.
It is simple, i am new, i don't know what cross platform ways are there and i ask to get your help.

> And what you say about Xamarin is gibberish.
So explain me, it shares code across Android, iOS, Mac OS and it has no GUI for 3 of them at the same time, it is meant to be common logic and separate GUI.

> Adobe... Everything created by Adobe is proprietary and, in certain sense, low-quality.
That is what i need from you, more information about Adobe AIR, ok it is low quailty.
But Unity3D is cross platform and it is not low quality, just look at games it made.

I know C# Windows Forms and want to choose WPF, but i would like something cross platform.
Sergey Alexandrovich Kryukov 14-Apr-15 15:02pm
   
By providing my information, I'm trying to treat people as friends, how else? It's not really simple to answer some questions like that, using vague or incorrect notions as "best". It's to your benefit to understand this incorrectness, not mine. The more you understand the better.

Now, "Xamarin shares code across, it is not one code running across" is the saying which does not make any certain sense and certainly cannot be true. You are missing some points about CLR. .NET is not the only implementation of CLR, there are some more. Nono covers Windows, Linux, Mac OS X and more, for different CPU instruction-set architectures, and Xamarine adds some missing platforms to it. The produced CIL code runs on different platforms without recompilation.

Another approaches mentioned by other members is using native code with cross-platform libraries. You can consider Qt, GTK+, FreePascal, and more.

—SA
Ziya1995 15-Apr-15 2:54am
   
> Now, "Xamarin shares code across, it is not one code running across" is the saying which does not make any certain sense and certainly cannot be true.
Xamarin shares code, it has no one GUI library for all 3 platforms, you make logic and create separate UI.
What are you talking about?

> using vague or incorrect notions as "best". It's to your benefit to understand this incorrectness,
I just said "best" to get some advice, not really number one in market, i could say:
What cross platforms libraries are there?
I hope now you got what "best" means here.
   
1. Yes, it makes no sense. No UI? Not true: http://developer.xamarin.com/guides/cross-platform/xamarin-forms. After all, looking is not enough, it needs seeing.

2. No, "best" does not mean anything certain. Something could be "best" for you, not for me.

I gave you a good list of cross-platform solutions, in the answer, after [EDIT]. Are you going to ignore it?

—SA
Ziya1995 15-Apr-15 3:06am
   
> After all, looking is not enough, it needs seeing.
It has no support for Windows.
Xamarin.Forms is not supported by Mac OS.

> 2. No, "best" does not mean anything certain. Something could be "best" for you, not for me.
Best means something good, not exactly number one, listen, you are really kidding me, skip this part, if you don't what know "best" means, you can skip this question, i am wasting my time talking about damn - what "best" means?!
I could say:
What cross platform APIs are there?
I am not gonna play philosophical games.

> Are you going to ignore it?
Of course no, i am gonna look at them.
   
Mono Forms are supported. You are missing all the points. The only problem is that you don't give yourself the labor to understand anything. Why I even waste time on you?
—SA
Sergey Alexandrovich Kryukov 14-Apr-15 15:07pm
   
You see, if you want to be focused on Adobe and insist that the answers should be focused on it, why asking the question you asked? If you don't want other alternatives, ask only about Adobe. It's not my goal to convince you, just the opposite: take your own responsibilities for your decisions.

Good luck,
—SA
Ziya1995 15-Apr-15 2:58am
   
> why asking the question you asked?
I asked the question to get information about cross platform libraries just like the ones i found on the internet.
But you didn't say anything about them(
But you said it is impossible, you meant they don't work, i am gonna check out them.
   
Not anything useful? Do you want to maintain this statement in from of other CodeProject members? I'm coming to the conclusion that nothing can help you with your attitude. You say I did not give information in cross-platform libraries? I say "they won't work?" Do you know that telling lie is bad? Indeed, what a shame. Look, everyone here can read all your comments. Did you think about it?

Let's close the issue. No seriously, let other members talking with you.
Let's agree on stopping this conversation.

—SA
Ziya1995 15-Apr-15 3:12am
   
> You can consider Qt, GTK+, FreePascal, and more.
Great.

i am checking out your [EDIT].

> I would not consider anything by Adobe as anything serious, but this is up to you to decide.
Advice is got, thanks.

> Not anything useful?
I am not fighting, skip this, i have no idea how to explain that Java, .Net and Xamarin do not support listed platforms, what best means and so on.

You said:
1. Qt
2. GTK+
3. FreePascal
and your [EDIT].
It look promising, great, that is what i wanted, now you understand what i want, thanks.

> Let's agree on stopping this conversation.
After the whole conversation you said great useful technologies, thanks.
   
Good. Of course, I did not mean to fight or something.
Now: Java is supported everywhere. I have no idea how you manages to exclude some platforms.
With Xamarin, you miss the point. You need to write common code which works on Xamarin on one system, Mono on another one, .NET on Microsoft's. Without recompilation. Are you getting it? And Microsoft promises multi-platform .NET at the end of this year.
—SA
Ziya1995 15-Apr-15 3:56am
   
> Now: Java is supported everywhere. I have no idea how you manages to exclude some platforms.
Windows, Linux, Mac OS.
No Android, no iOS.
http://java.com/en/download/help/sysreq.xml

> With Xamarin, you miss the point. You need to write common code
I know it, i checked out Xamarin too, common code is not GUI, it is logic behind, i will still need to write platform specific codes separately

> And Microsoft promises multi-platform .NET at the end of this year.
Sounds great, i know C# Windows Forms.
I checked out .Net Core, it has no GUI.
Will i be able to write C# code once and run on all said platforms without correcting code for platforms separately like in Xamarin?
   
Do be serious. Java.com? Do you think they are supposed to list all platform?
How about checking Android and Mac OS? On Android, it's the main language. :-)
I already told you that Java is available on all those platforms.

"I know it, i checked out Xamarin too, common code is not GUI, it is logic behind".
Again, not true. I'm not sure you got the point.

Look, with your level of attention to the sources, we can waste too much time. Please, give yourself the task to put a lot more effort in reading. You are making rounds...

—SA
Ziya1995 15-Apr-15 4:05am
   
> On Android, it's the main language. :-)
Android Java is different and you can't run Oracle Java running on Windows on Android.
   
This is the whole point: you have to write compatible code...
What do you want from these platforms, which have been developed to be incompatible. Trying to find something better? I'm trying to suggest something probably the most compatible you can find, not even trying to satisfy your appetite for ideal world, please understand it... :-)
—SA
Ziya1995 15-Apr-15 4:37am
   
> On Android, it's the main language. :-)
C++ QT (no Mac OS), Adobe AIR (no Linux) support almost all said platforms - Windows, Androids, iOS.
But other 2 guys said it is impossible
> The short answer is: no, you cannot do it.
> its no good in any one based on performance

C++ QT compiles into native + performance.
Adobe AIR can compile into native too.
What is a problem?

And some people say being cross platform doesn't work, it is buggy.
   
All right, you have all chances to ram it all...
—SA
   
Try not to ignore detail, it helps. It says v2 17 hours ago...
You are welcome.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900