2

I am looking for some implementation advice on a cross platform application I am trying to build. I am hoping for something straight forward.

I would like to create a small application that works on both Windows and Mac that allows users to type in their username and password upon install and once this is done, to act as a background service to poll my server every second for tasks to perform. They will mostly be file read/write and upload operations.

I am currently thinking about using the Mono project, However, I have never used it although I am comfortable with C#.

Are there any other options I should consider? I'm not sure about Java as I have a feeling that the interface may be ugly/different across different platforms.

I am hoping my app has no friction in terms of dependencies that the user has to go and get.

I appreciate any input on this.

Abs
  • 56,052
  • 101
  • 275
  • 409
  • Would love to hear thoughts on installation process. For example, is there a JAVA installer so that it runs as a service? – Abs May 02 '12 at 19:56
  • the problem with C# in this respect is that you arguably lose support for one of the most important aspects of the language: a large part of the Windows-specific Microsoft .NET libraries. – Adam May 02 '12 at 20:03
  • *"the interface may be ugly/different across different platforms."* Given users usually consider their 'default look' to be 'good', your best bet is to use the native look and feel. Java provides that ability 'out of the box'. See this answer on [Nested layouts](http://stackoverflow.com/a/5630271/418556) for images of the native PLAF on Windows, OS X and *nix. – Andrew Thompson May 02 '12 at 20:04

4 Answers4

2

Regarding the look and feel:

I wouldn't worry too much about the look and feel of a cross-platform Java application. Java's Nimbus look and feel looks quite good actually and is bundled with Java already: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html

Additionally, one can find many different free, cross-platform, look and feels that you can bundle with your software. I myself am a big fan of the TinyLAF look and feel: http://www.muntjak.de/hans/java/tinylaf/tinyscreen.html

I have written several economics applications in Java and I think they look good on Macs as well as Windows machines. (The only thing I have found is that menu bars sometimes look strange on Macs.)

--

One other thing to be mindful of is the file structure differences on Macs and Windows machines; if your program involves outside files make sure you don't hardcode in anything platform specific (like directory separators).

richard
  • 605
  • 5
  • 8
  • 1
    For your last part, I would actually suggest to use the forward slash ('/') most of the time. You can get backward slahes only on Windows when interacting with native API (File.getCanonicalPath() for example, or JFileChooser.getSelectedFile()). You can create a `new File("c:/test.txt");` on Windows without problems. – Guillaume Polet May 02 '12 at 19:52
  • Thanks for the tip on file paths and on themes. This worried me a bit especially on macs! – Abs May 02 '12 at 19:55
  • @GuillaumePolet *"use the forward slash ('/') most of the time"* Use `System.getProperty("file.separator")` over hard-coding it! Alternately make files using the `new File(parent, name)` constructor to get the correct separator automatically. – Andrew Thompson May 02 '12 at 20:08
  • @AndrewThompson I am developping an app (with model files that are shared by Unix & Windows) that uses a lot File and stuffs and eventually, the code was a lot simpler once we used mainly (if not only) the forward slash. In some situation, it may be usefuf, I don't deny that – Guillaume Polet May 02 '12 at 20:27
1

If you want a nice UI you could also consider JavaFX (a Java-based RIA technology).

Puce
  • 37,247
  • 13
  • 80
  • 152
0

For the User Interface, there are some bits and pieces to adjust, but using the system look & feel, the experience is quite smooth (it looks like other native applications). In a Java application, you can configure the Look & feel for the whole application, making it looking quite integrated and quite natural. So I would not fear too much that.

For C#, I thought this worked only on Windows and not on Mac, but maybe this has changed?

Guillaume Polet
  • 47,259
  • 4
  • 83
  • 117
  • 1
    Mono sounds awesome. Mono is a software platform designed to allow developers to easily create cross platform applications. http://www.mono-project.com/Main_Page – Abs May 02 '12 at 19:53
  • @Abs I never used C# so I don't about that. I have no idea on how they do stuff (is it efficient?) and how user interface is done in other platforms than Windows. All I can state is that you can have a native look & feel in Java. – Guillaume Polet May 02 '12 at 19:56
0

First off, I don't think you're going to get away with a dependency-free application. Go with Mono, and you have to have that installed. Same goes for Java, for that matter.

I would consider having two components in your client application. One would be the background worker that would poll your server and do the work. The other would be the GUI app that handles logins, things like that. The former could be an application written in Java. The GUI client could be Java, some other platform, or even then it may be palatable to have a port for each OS, as it should be a very simple application at that point.

Personally, I'd recommend avoiding Mono, simply because the project is really no longer being maintained by anyone. If you really don't like the UI options offered by Java, perhaps you should consider Flex. However, then you are talking about a proprietary platform with expensive development tools. Really, I think you should reconsider what you have available with Java. It's not like it used to be, with the ugly, pinkish, 1990s X-windows looking interface items. Eclipse is a prime example of that.

Sean H
  • 736
  • 6
  • 9
  • Mono is still being maintained by Xamarin. See this press release from Novell. http://www.novell.com/news/press/2011/7/suse-and-xamarin-partner-to-accelerate-innovation-and-support-mono-customers-and-community.html – Peladao May 03 '12 at 08:16