How to write applications for different platforms? Linux, Mac, Windows and Mobile Platforms
Asked Answered
C

7

6

We want to write a client for an online service which should be available on as many platforms as possible. This question is about what programming language and framework we should use to create this client. These platforms are required: Linux, Mac, Windows, iOS (iPhone, iPod, iPad) and Android. The more the better.

For the mobile platforms there is Titanium Mobile. I haven't tried this thing yet, the website says you can develop for both iOS and Android using web skills such as Javascript. I don't know yet if you can deploy for both platforms using the SAME code. It would be great!

There is also Titanium Desktop but I don't like the idea that the complete source code is shared with the final application. Titanium does this for Mobile too but it isn't that easy to modify an app loaded via App Store.

So, what other way is there to create an application which runs on at least the three major desktop platforms? I thought c# with mono would be the way to go but I just realized that you need to use mono with MonoMac in order to publish it on the Mac App Store and use things like Growl. And since MonoMac is naturally only available for Macs, it's again not possible to deploy the mono app on all platforms without rewriting it for at least the Mac. And it would be nice if the app looks "native" on all platforms. Gtk# just does not look good on a Mac. It's "okay" on Windows and great on Linux.

I know we could use Objective-C for iOS and Mac, Java for Android, C#.net for Windows and C#.mono for Linux but the main point is that we don't want to write the same app in a lot of different languages. That would make development and maintenance really hard.

And we prefer languages with C-style syntax which are much easier to learn for us PHP web developers. Btw: We dislike Air and I'm not sure about Java since I never used it but it also does not look "native" and it feels kinda slow.

Edit:

Just a note: It wouldn't be a problem to create an own form for each platform if at least the remaining code is the same. Is it possible to use MonoMac, Gtk# and Win Forums in the same C# application? And I'd prefer C# over C++ as I have no skills in C++, so I first need to check how hard it is to write with Qt.

Another note: We don't plan to spend much money and because we need to pay Apples Developer Programs we want to use free or cheap technology. Preferable Open Source.

Claret answered 15/3, 2011 at 21:36 Comment(1)
Just a note: It wouldn't be a problem to create an own form for each platform if at least the remaining code is the same. Is it possible to use MonoMac, Gtk# and Win Forums in the same C# application? And I'd prefer C# over C++ as I have no skills in C++, so I first need to check how hard it is to write with Qt. Thanks.Claret
G
10

Just use C# for all of the above.

The mono project will cover Mac and Linux, with monodroid your android requirements are covered and monotouch will take care of iPod/iPad/iPhone.

In regards to UI - mono has full support for the System.Windows.Forms namespace, so you don't have to use GTK# if you don't want to.

I don't think I need to mention windows support ;)

Genu answered 15/3, 2011 at 21:40 Comment(8)
@AbiusX - What are the other choices then? And what are you basing this on?Genu
@AbiusX - You are not answering why C# is not a good choice. You are simply telling me your opinion.Genu
@AbiusX :But on what are you basing your "this is not a good choice, trust me" comment?Nina
Refer to the usage percentage of programming languages on Wikipedia, and also on the number of software developed with C# and Qt (also on Wikipedia) and of course the performance of Qt vs C# (its even noted on XNA's website)Augustin
MonoTouch is quite expensive if you use it for a commercial application and there is no information about monodroid pricing, maybe it'll cost as much as MonoTouch. Plus the iOS / Mac Developer Plans. A lot of money...Claret
@Claret - You didn't mention anything about cost in your question... Was I supposed to guess?Genu
@Claret - Just saying that if cost is a concern, you should put that in your question.Genu
Both of these links do not load anymore.Arcograph
L
8

If you really want to support all those platforms from a single application, your best bet will be to create a web application. With HTML5, such an application can even be cached on the device and used when no connection is available. Also, that strategy would make it feasible to customize the UI based on the device running the app.

You will not have good luck if you set out to build a single native app that runs on Android and iOS, let alone all the other platforms you mentioned. The reason that they're different platforms rather than the same is that they're, well, different. They have different capabilities, run on different hardware, are built with different languages, employ different application models with different user interfaces, and have audiences with different expectations.

Lowe answered 15/3, 2011 at 21:43 Comment(4)
+1. You beat me to it. Really, this is the only option for true cross-platform operability, and even that will be based on how well the browser supports what you write, and how the os/device is configured.Tronna
Everyone's looking for a way to write native applications for all the major mobile platforms without having to do any extra work. It's just not there. Plenty of vendors promise that sort of thing, but what they have to deliver is some least common denominator platform-within-a-platform, and you're usually tied to their servers (and their accounting department). If you're going to use some common platform, you might as well at least do it with open standards on your own server! And if the OP is a PHP developer, they've already got a good start. Cheers.Lowe
No kidding. Cross-platform development for mobile devices is a nightmare. I'm remembering the early web days when Netscape had Layers and no two browsers worked alike, and thinking that cross-browser compatibility was a breeze compared with trying to decide what to do for native mobile apps. At least there were common items that worked in ALMOST all browsers then. I'm sitting this one out as long as I can and sticking to web, even if it leaves me in the dust. (But I'm brusing up on my Java just in case.)Tronna
We're also going to write a web client but we need real application. Image upload, voice recording, Push notifications, ... just not possible on iOS using Safari.Claret
A
5

The best solution I've come across over the years is Qt SDK. Great support for all major platforms, Symbian, OS X, Linux flavors, Windows, Windows CE (mobile), Android and iOS partial support and etc.

Its base is C++ but bindings for almost every language (like C#) is available. Lots of help and support is also covered.

The core Qt libs are very fast and extensive, And the whole KDE desktop (of Linux) is done with it. Famous software like VLC and VirtualBox are done in Qt.

Augustin answered 15/3, 2011 at 21:44 Comment(3)
Is there any slated support of Windows Phone 7?Permute
I have no idea, check Qt website. But since its pure C++ i support it can be ported easily.Augustin
How do I set up a Qt and iPhone dev environment using C# on Linux?Arcograph
F
3

Another relatively new way of doing cross-platform development is to use the open source Eto.Forms, which allows you to have one UI codebase target each platform's native toolkit. It is a UI abstraction layer that can target GTK#, MonoMac/OSX, WinForms, and WPF.

There is also an iOS port in the works.

Flavouring answered 21/1, 2012 at 19:32 Comment(0)
S
2

Java sounds like the best fit. It is cross-platform, easy to understand, has a huge userbase and android is based on it.

Shipyard answered 15/3, 2011 at 21:38 Comment(6)
I do not think Java is supported on iOS.Sorcerer
Android also doesn't support the standard Java libraries, it uses the syntax only.Gastrectomy
Along with no support on some handhelds, and a very heavy and slow virtual machine interpreter requirement, Java is a very orthogonal programming language and hence not appropriate for fast/advanced programming.Augustin
I believe there is no official support for Java on iPhone.Permute
there is a project to cross compile to iphoneShipyard
@Augustin - Contrary to popular belief (and Qt fanatics), the Java virtual machine isn't actually that 'slow' - even a year ago since that is how long ago you answered. It may be slower based on operations being performed, but you appear to be speaking from a general sense. As for where Java is the answer as a good cross-platform solution (language), I would have to say I disagree. IMHO, just write both natively. Android and iOS development are pretty easy for light clients. Then choose mono for your desktop applications. If you want to code once deploy everywhere, prepare to spend big $$$Venule
E
1

Depending if you need an offline interaction mode, it sounds like you should develop a web application. You can develop a mobile version and a desktop version and thus support all the of the above platforms. Look at youtube's application for Iphone, it retains the same functionality as the the iphone app but is purely html. Furthermore, html5 capable browsers could also have the ability to run offline.

Ebersole answered 15/3, 2011 at 21:52 Comment(0)
M
0

Crazy as it sounds, check out Flash/Flex - it is cross platform, code once, run everywhere ,now compiles down to native code on e.g. Android and iOS and the 10.1 player is shipping all over. I had to solve exactly this problem and when Flash Builder Burrito catered for mobile after working with it for a while I have switching from C#/Flash hybrid to Flash only for clients. (Our backend is C#/Node/C++, etc).

Depending on your timelines and needs it is something look into.

Some random links to peruse:

Blog post about performance and video to single app multi device

Developing flash and flex applications

Macrocosm answered 1/4, 2011 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.