views:

312

answers:

5

Is there a way, apart from using HTML and JavaScript on a web control, to have an (almost) single codebase for an application that should run on iOS and Android?

The big issue is of course that they use a different language (Java for Android, Objective-C for iOS) for application development. It would be nice to have some sort of meta-language that will be translated in Java and in Objective-C.

What about Flash? Adobe wasn't supposed to release a tool to create flash-based apps in iOS?


Update: based on current answers, the best cross platform development tool for iOS and Android seems to be Titanium appcelerator. I suspect that this topic will evolve overtime, so feel free to contribute with new information and comments. Thank you!

+2  A: 

Apple are against Flash on iPhone (for performance reasons they say) and there's been a lot of discussion about this. The iPhone OS 4 license agreement states that "applications must be originally written in Objective-C, C, C++ or JavaScript" and 'translating' is prohibited, which affects Adobe's tool, as well as the Mono project.

Rox
But translating is prohibited at run time or even at "compile time"? I mean, if I do a tool that generates Objective-C code from a random meta-language, it would be prohibited?
Lorenzo
It is even prohibited on compile time
Janusz
You can generate the code, open it in Xcode and do the final steps of coding/deployment on a Mac, and that should be ok, but the final code has to be in Objective C
Rox
@Janusz: "generating Objective-C code from random metalanguage" fits this prohibition?
Lorenzo
@Rox: OK... that's what I was thinking about. Is there any commercial or open tool to do that? Or at least an attempt? This would be SO useful, at least for basic apps with simple GUI.
Lorenzo
@Lorenzo: we're developing in Objective C and didn't look for alternatives so I can't recommend anything
Rox
+3  A: 

You can try making your libraries with native code (C or C++) and use them in both platoforms. the android ndk and iphone.

Mina Samy
How would that work? Android apps support only Java...
Lorenzo
you can check this link http://www.developer.android.com/sdk/ndk/index.html
Mina Samy
Wow. I'm such a newbie in Android development that I never noticed it!
Lorenzo
+3  A: 

You could use Titanium appcelerator. Titanium allows you to write apps in an abstract way with java script and then compile it to a mix of java script and native code. This gives you a native look on Iphone and Android with only a single java script code base.

Titanium states that their approach complies with the terms of service of apple and their are some titanium apps in the android market and itunes store.

Janusz
That seems sooo cool! I'll check it!
Lorenzo
Hmmm... of course it is HTML+JavaScript :-( - It is still nice, but it is something you could probably achieve without the need of a middleware.
Lorenzo
In the new version they are not using any html at all. You are creating the whole UI in your java script files. Have a closer look download the developer and look into the kitchensink sample app
Janusz
A: 

You can create Html5 apps..Both android and iOS supports html5 http://sixrevisions.com/web-development/html5-iphone-app/ and for Android http://grammerjack.blogspot.com/2010/05/writing-android-application-in.html

Chandan Shetty SP
Yes, however I asked "apart from using HTML and JavaScript"...
Lorenzo
+2  A: 

Depending on your task at hand, you may use other, specialized solutions. For instance, if your code is heavily networked (e.g. you're building a social network or a music sharing app), requires WiFi, location, proximity, ad-hoc, connectivity to Android, iPhone, BlackBerry, Windows Mobile, or Symbian, app discovery, etc., then a solution like Mobile Community Framework (www.uvamobiltec.com) may work for you. You'd still need to write some code, but the most complex parts of the job would be done for you by the framework code, which is native to every platform.

uvamobiltec