tags:

views:

39

answers:

4

What's the best way to write an application in order to get it working on the several phones out there (iPhone, symbian-based, xpPhone, and so on)?

The idea I have in mind is that of writing a few interfaces to abstract from phone-dependent stuff (ie: some Input/Output interfaces), implementing such interfaces on the several phones and then writing an application that doesn't use any phone-dependent thing.

But is this really possible? What would be the language I should choose for my interfaces and applications? (would love to use C++, hopefully even with GCC extensions)

Is there any project that aims to offer what I need? (maybe something like SDL?)

A: 

In short - you can't. There is no common language that would cover ALL phones. You might get lucky by going into Flash and Web based apps (but iPhone doesn't support these)

Riho
A: 

There is no easy answer to this question.

First of all, I guess your best bet will be JavaME: will give you access to most of the platforms but iPhone/iPodTouch.

Other alternatives might be:

  1. .NET: Will give you Windows Mobile, iPhone (if you use MonoTouch) and probably more platforms once MonoTouch extends its product to support Symbian, Blackberry, Android (They never actually said they will extend it, but I bet they will)
  2. Flash: This is a pretty controversial one. Again, you will probably get most of the platforms out there with Flash but iPhone.
  3. Write Your Own: You can choose any language you want, but you will have to write COMPILERS/TRANSLATORS for each platform. Not a trivial thing to do.

If I were to write one my own, I would not choose C or C++. I would choose something simpler like HTML/CSS/ExtendedJavaScript. The way Firefox deals with its extensions.

Pablo Santa Cruz
+1  A: 

Make a web app. As per Jobs' latest stroke of "genius", webapps are the only (sort of) portable frameworks allowed in the iPhone OS...

Victor
A: 

I would echo the J2ME comment above, but would add that you really need to think about what you are trying to do carefully first, and it would be a good idea to download some existing j2ME applications to make sure you are comfortable with the speed and look and feel of them across your target phones.

If you have the luxury, it may be better to aim for two or three of your most likely target phone/platforms and build a quick prototype of your application for each one to get a better feel for what parts (if any!) it is sensible to try to make common across them.

Mick