views:

107

answers:

1

If you've worked on a cross platform development project what advice do you have for someone (like myself) considering starting one? Examples:

  • What worked?
  • What didn't?
  • What problems did you run into and how did you solve them?
  • Did you aim for consistent appearance and functionality across all platforms or try to take advantage of each platform's strengths?
  • What language and cross platform libraries did you use and did they live up to their claims?
  • Was it a desktop, mobile or web-based application?
+4  A: 

I worked on a small cross-platform project. The app was a desktop app, distributed directly as an executable on USB.

Did some research initially - you might be able to trace my stackoverflow questions - and settled with Mozilla's XULRunner.

It worked really well in terms of being cross platform - you're basically running off a well cross-tested platform that runs firefox and thunderbird, so the crossability (is that a word?) is pretty bullet proof.

Its first flaw I thought was the documentation - there is a lot out there, but it's a bit obscure at first.

But then, the mozilla forums community is awesome, really friendly and helpful.

In terms of development, it's all javascript and a bit of html-like marker language called xul and styling using css (you can also build extensions in c++ if you need, but the core is pretty powerful as it), so it's pretty familiar right away and pretty flexible too.

XUL gives a good platform-specific native feel to the apps (IMO), or you can re-do entirely your chrome elements and make a custom ui.

One major gotcha with XUL is that because of the way XULRunner works, your source code will be more or less pretty much viewable by anyone. If you have proprietary code this may not be ideal for you - or you will need to isolate in a separate library written in c++ (XPCom components in Xul terms).

I'd highly recommend it. I had a pretty short turn around time frame to build the project and it really saved my ass. I did the development on a Mac, and it worked right away on PC without any major change.

Additionally, there was other platforms that I reviewed for this project.

  • I've seen some strong support for cross platform UI kits & languages like QT (with PyQT for instance), or tcl/tk and such. I wasn't too taken by it but you might want to look into it.

  • Some people suggested AIR, JavaFX and .NET/Mono. For me this wasn't viable as it's too much of a dependency on some systems (XP doesn't come with Java, Mac doesn't come with .NET/Mono, neither come with AIR). If you want something that will just work out of the box, that doesn't fit the bill. But your requirements may be different.

  • Titanium (from Appcellerator) is probably the closest contestant to XULRunner. It seemed great, quite powerful but the desktop development edition has pretty awful debugging features compared to XULRunner. Their agenda is more toward the mobile dev edition, which I can understand, but I wish they'd care more for the desktop edition. However, if cross-platform mobile development is what you're after this may be good - though I haven't tested it for that purpose.

Hope this helps.

Ben