views:

794

answers:

3

Since both iPhone and Android support OpenGL ES, is there any open source or commercial GUI library we can use for these two platforms? Or is it doable (or how difficult) to port an application from one to another platform?

As I know, for iPhone only, libNUI (http://www.libnui.net) is a good choice (dynamic layout & mature), but it only provides GPL & commercial license. Any other open source tool similar with libNUI?

A: 

I wouldn't think there would be a library that will work across both platforms since iPhone stuff is written in Objective-C and Android is C/C++/Java.

CaseyB
If you get a GUI toolkit that runs under OpenGL ES you should be able to create wrappers for both iPhone and Android, the work will be to map the different input events for each of those plattforms to the underlaying GUI layer. You can do C/C++ development on the iPhone so there is a common denominator
Harald Scheirich
Jeff
A: 

I have never used it but I just read about cocos2d-android earlier today.

From their site:

cocos2d for Android is a framework for building 2D games, demos and other graphical/interactive applications. It is based on the cocos2d-iphone design: it uses the same API, but instead of using objective-c, it uses java.

(here is a link for cocos2d-iphone)

So yeah, I have never used it, and I don't think you will be able to share source files between the 2 platforms because as they mention it uses Java instead of objective-c

It may be possible to create a library that can be used by both platforms, but I am not 100% sure about this. The Android NDK (native development kit) allows you to write some functions in C and C++ and hook into them in an Android application via JNI (Java Native Interface). The latest NDK supports OpenGL ES 2.0 So it may be possible to share code, but I am really not sure.

snctln
+1  A: 

Clutter is by far your best bet. ( I made this question a while back for iPhone, located here ) . There where some builds of Clutter for iPod/iPhone at the time, but I don't know if they are still there, however I know that the work involved in doing such builds shouldn't be to heavy.

For android you would have to do the Java Bindings, totally possible though, and maybe someone already made them.

Good luck!

Mr.Gando