Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Cross Platform app - recommendation

I need to build a fairly simple app but it needs to work on both PC and Mac.

It also needs to be redistributable on a disc or usb drive as a standalone desktop app.

Initially I thought AIR would be perfect for this (it ticks all the API requirements), but the difficulty is making it distributable, as the app would require the AIR runtime to be installed to run.

I came across Shu Player as an option as it seems to be able to package the AIR runtime with the app and do a (silent?) install.
However this seems to break the T&C from Adobe (as outlined here) so I'm not sure about the legality.

Another option could be Zinc but I haven't tested it so I'm not sure how well it'll fit the bill.

What would you recommend or suggest I check out?

Any suggestion much appreciated

EDIT: There's a few more discussions on mono usage (though no real conclusion): Here and Here

EDIT2: Titanium could also fit the bill maybe, will check it out.

Any more comments from anyone?

EDIT3 (one year on): It's actually been almost a year since I posted that question but it seems some people still come across it every now and then, and even contribute an answer, even a year later.

Thought I'd update the question a bit. I did not get around to try the tcl/tk option at the end, time constraint and the uncertainty of the compatibility to different os versions led me to discard that as an option.

I did try Titanium for a bit but though the first impressions were ok, they really are pushing the mobile platform more than anything, and imho, the desktop implementation suffers a bit from that lack of attention. There are also some report of problems with some visual studio runtime on some OSs (can't remember the details now though).. So discarded that too.

I ended up going with XULRunner. The two major appeals were:

  • Firefox seems to work out of the box on most OS version, so I took it as good faith that a XULRunner app would likely be compatible with most system. Saved me a lot of testing and it turned out that it did run really well on all platforms, there hasn't been a single report of not being able to start the app
  • It's Javascript baby! Language learning curve was minimal. The main thing to work out is what the additional xpcom interfaces are and how to query them.

On the down side:

  • I thought troubleshooting errors was a sometimes difficult task, the venkman debugger is kinda clunky, ended up using the console more than anything.
  • The sqlite interface is a great asset for a desktop app but I often struggled to find relevant error infos when something didn't work - maybe i was doing it wrong.
  • It took a little while to work out how to package the app as a standalone app for both PC and Mac. The final approach was to have a "shell" mac app and a shell pc app and a couple of "compile" script that would copy the shells and add the custom source code onto it in the correct location.
  • One last potential issue for some, due to the nature of xulrunner apps, your source code will be deployed with the app, you can use obfuscation if you want but that's something to keep in mind if you want to protect your intellectual property

All in all, great platform for a cross-platform app. I'd highly recommend it.

like image 732
Ben Avatar asked Mar 01 '10 00:03

Ben


People also ask

Which is the best mobile app when we need cross-platform?

React Native React Native is a popular cross-platform app development framework for both iOS and Android. React Native is undergoing constant improvement and is supported by a large community. React Native is based on React and doesn't involve the use of WebView and HTML technologies.

Why should we develop cross-platform apps?

In cross-platform app development, a single and a universal app is compatible for running on all platforms. This makes it easier to maintain and deploy code as changes are made. Updates can promptly be synced over all platforms and devices, thus saving time and money.


1 Answers

Tcl/Tk has one of the best packaging solutions out there. You can easily wrap a cross-platform application (implemented in a fully working virtual filesystem) with a platform-specific binary to get a single file executable for just about any modern desktop system. Search google for the terms starkit, starpack and tclkit. Such wrapped binaries are tiny in comparison to many executables these days.

Many deride Tk as being "old" or "immature" but it's one of the oldest, most stable toolkits out there. It uses native widgets when such widgets exist.

One significant drawback of Tcl/Tk, however, is that it lacks any sort of printing support. If your application needs to print you'll have to be a bit creative. There are platform-specific solutions, and the ability to generate postscript documents, and libraries to create pdfs, but it takes a little extra effort.

like image 149
Bryan Oakley Avatar answered Sep 21 '22 13:09

Bryan Oakley