Building Cross Platform app - recommendation
Asked Answered
Z

5

5

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.

Zealous answered 1/3, 2010 at 0:52 Comment(7)
where did that answer on using Mono disappear? I can't see it anymore...Zealous
a downvote? really? after such a long time?Zealous
Thanks Ben for such a detailed post. How is XULRunner working out for you till today? Is it still applicable?Slub
@Slub Well this was 5 years ago now, that a very long time for a tech project. I completed that project a while back and handed over ages ago. I would start fresh and investigate any new option definitely – i'm not even sure if it's still actively maintained by mozilla or if they've moved on.Zealous
Thanks for the reply Ben! If you ever do this kind of research again please do share! You do a good job at it!Slub
@Slub You might like to read this recent post on Raymond Camden's blog regarding app built using Electron raymondcamden.com/2015/07/23/… - it's pretty insightful and more up to dateZealous
Thank you Ben that is spectacular!Slub
C
5

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.

Coccid answered 1/3, 2010 at 1:2 Comment(4)
Wouldn't that require tcl/tk to be installed first?Zealous
@Ben: No. You wrap the whole tcl/tk runtime into a single file. It's less than 4 megabytes total. That's the beauty of it. You end up with a single file that you just drag to a folder and it's installed. No extra runtime or anything (unless you elect to keep the runtime and the application separate)Coccid
@ Bryan: Thanks for your suggestion (and your enthusiasm!). It would fit the bill. My only concern is that i've never done tcl/tk so I would have that learning curve on top of some crazy deadline..Zealous
For an introduction that might give you an idea of how easy or hard it will be to get started, take a look at tcl.tk/about/language.html for Tcl and tkdocs.com/tutorial/index.html for TkBombycid
H
2

Java is probably your best bet, although not all Windows PCs will necessarily have Java (most should). JavaFX is new enough you can't count on it - you'll probably find a lot of machines running Java 1.5 or (shudder) 1.4. I believe recent Mac OS still ships with 1.5 (latest version may have changed to 1.6).

Hithermost answered 1/3, 2010 at 1:0 Comment(1)
Thanks for the tip. PCs don't come with Java pre-installed afaik (I've always had to install it). That's too much of a dependency, I might as well go with Air. And I'd personally prefer to stay away from java if possibleZealous
E
0

Consider JavaFX It would run everywhere with a modern JRE ..!

Eben answered 1/3, 2010 at 0:56 Comment(1)
Thanks. As with @Michael E's answer. Java is too much of a dependencyZealous
S
0

AIR could be an option, but only if you don't mind distributing two different files (the offline runtime installer and your app), and expecting the user to run one and then the other. You do have to submit an online form at Adobe's site saying you agree to distribute the offline installer as-is, rather than digging out individual DLLs or whatever, before they give you the installer.

Unfortunately there's currently no way to get both an AIR app and the runtime to install from one file though. I'm not sure what the deal with Shu is, or whether it's doing anything that isn't kosher.

Spoonbill answered 21/3, 2010 at 14:49 Comment(2)
Thanks for the tip. As mentioned in my question, AIR alone won't do. I did look at shu but it requires the air distribution from adobe. We applied to adobe for the air license but never heard anything from them. Fine if you don't care adobe.Zealous
Went we xulrunner, it's a bit difficult at first but it's pretty awesome once you get your head around it.Zealous
I
0

i would recommended zink. it has all the functionalities you require for desktop. however, the las time i used it it was a bit glitchy.

i was hung up by trying to write a 6M file to the disk. thought it trough and changed the code to write 512K chunks at a time (3min work, fast).

probably it still has some little annoying glitches like making you think on root lvl but the ease of use and the features are just way too sweet to ignore.

Inerasable answered 4/5, 2011 at 9:48 Comment(3)
You meant zinc? sounds like you're both recommending it and turning it down at the same time :) Wasn't too impressed with it when I reviewed it. Went with mozilla's XULRunner at the end, it's been a very interesting - though somewhat challenging platform. Look into it.Zealous
thx for the tip on XULRunner. and, yes, i meant zinc. i didn't used it extensively, in fact it was for personal use only. developed some specialized tools with it (that was almost 2 years ago). and i am NOT saying i downloaded illegally :) if i have extensive work for offline apps i'll definitely buy it. that might not be the case since majority of systems are connected to the web.Inerasable
Thanks for your input on zinc. I'v added an Edit 3 to my original question if you're interested to see why I picked XULRunner at the end.Zealous

© 2022 - 2024 — McMap. All rights reserved.