10

I want to build a SyncML parsing library (no UI) which should be able to build up messages based on information provided by the host application, fed in by the library's methods. Also, the library should to be able to do callbacks to methods in the host application.

I want to be able to compile this and have it available on as many platforms as possible: Windows, Windows Phone 7 OS, OSX, iOS, Linux, Android, BlackBerry. Basically as many platforms as possible.

The priority is to have this available on mobile devices.

Questions:

  1. What setup should I use? (programming languages, compilers, IDE etc.)
  2. How would I compile this library for these different platforms and how would I connect to it?
  3. Any other info? e.g. articles that cover the subject of cross-platform development?

I haven't done this sort of a cross-platform project before, so any available information to put me in the right direction would be welcomed.

Myself, I have a background in C#/.NET and Objective-C.

Alex
  • 587

4 Answers4

8

Using the Java platform / JVM would be the obvious choice - it has the widest cross-platform coverage of any language, and if you have a C#/.Net background the concepts will be very familiar.

Note that you don't have to use Java language to gain the benefits of the Java platform - in fact nowadays, if starting a project from scratch I'd probably recomemnd one of the following:

  • Scala - if you want a powerful, statically typed, multi-paradigm langauge with great performance on the JVM. Could suit you if you have a C# background.
  • Clojure - if you prefer functional programming, like dynamic languages and enjoy living on the cutting edge. Clojure has truly excellent concurrency capabilities which may be appealing - the linked video is well worth watching for some deep insights.
  • Groovy - if you want a simple-but-effective dynamic object oriented scripting language that will feel very familiar to C#/Java developers.

All these languages get all the benefits of being on the JVM (fantastic JIT compiler, very effective garbage collection, a huge set of libraries) but are much more productive languages to work in.

By the way, there's already an open source SyncML library available in Java called Funambol. Not sure of the extent to which this is useful directly to you but it's an example of the fact that there is usually an open source Java library for pretty much anything.......

Thoughts on other options:

  • C/C++ can certainly work cross-platform, but it requires a recompile (and subsequent testing) into native code for each platform. With JVM languages that isn't necessary as the compiled bytecode itself is portable. Unless you absolutely need C/C++ for performance or access to raw hardware features, I think it is a headache you should avoid.
  • C# in the form of Mono could work (witness the success of Unity as a cross-platform library for example), but it's nowhere the JVM ecosystem in terms of maturity, library availability or even raw performance. Also it's never going to be 100% compatible with Microsoft .Net since .Net has windows-specific features which are a nightmare for portability. Still, worth considering if you are determined to stick with C#.
  • Javascript might be an outside option if you are interested in using the library on both the client and server side.
mikera
  • 20,777
4

.NET is hardly available on many platforms, and Objective-C is even worse, plus .NET is kinda slow and ObjC has basically no support outside Apple. C as a language is basically not even worth considering unless some external factor makes you use it.

The only result viable language is C++.

DeadMG
  • 36,914
3

You might want to try Java - Java Runtime Environment (the virtual machine) is cross platform, Java may be used in mobile devices with Android (or with Java ME) and .NET is very simillar to it.

malejpavouk
  • 279
  • 1
  • 6
3

This is not one choice but many. While it is tempting to find one thing that goes everywhere, it is not always the best way to do.

  1. For example, while it may be possible to squeeze a C++ code in Windows mobile platform, anything .NET will always be easier here than its' counter part from the point of view of support.

  2. Similarly, one needs to make a major choice whether you want it to be native or under run time and are you strictly limited to Web centric or more generic powerful one? For example, Adobe Runtime is more omnipresent but it will limit to what you can do compared to with core programming languages.

  3. Most important thing i guess, is the type and level of GUI you want to built.

Now comming to most promissing choices.

a. For Symbian, Blackberry, Android, BREW and Bada (samsung) Java/J2ME is the commonest way. Though, you might be better of with C/C++ in many cases, for native core stuff in some platform.

b. For Windows .NET with any supported language would be good.

c. For iOS - there is no choice but Objective C. This is NOT very much C++ so i won't count it as a objective

Here is a wiki reference which shows set of all platforms that shows you all options and where they apply.

Thanks to your question, i learned from the above wiki link that there are now SDKs, that try to solve above problem. The two that comes closest are:

  1. Marmalade : http://www.madewithmarmalade.com/marmalade/supported-platforms this interestingly support almost all platforms. Windows is just about getting added to make complete circle.

  2. Particle Code : http://www.particlecode.com/

I have not used them yet, but sounds interesting work.

Dipan Mehta
  • 10,612