views:

5971

answers:

18

I am interested in writing applications for the iPhone and the Android platform. I was hoping to find a middleware / framework that abstracted away some of the differences in the APIs and allow me to specify the target platform at build time. Is there such a framework existing or planned?

A: 

There's nothing existing (worth relying on, if anything at all), and I doubt that there would ever be anything official planned.

Greg Hurlman
+1  A: 

Not that I know of. It is possible to build the application as a web app? The web is great for platform independance. :-)

andyuk
I don't know about anyone else, but I hate web-apps on mobiles. They're WAY slower than native. That said, you could do a write-once run-everywhere app this way.
fiXedd
A: 

Such a framework, by nature, couldn't take advantage of iPhone-specific features like the accelerometer or multi-finger gestures. It would also likely void Apple's SDK terms.

As andyuk suggested, consider writing a Web app. Basic features such as calling someone can be accessed that way.

Sören Kuklau
+2  A: 

Even if you really wanted to, it wouldn't be practical to make your own multi-platform framework – iPhone is native code, Android is Java.

Of course, there isn't anything stopping you from, for example, sharing the core C/C++ logic in a desktop application with its iPhone counterpart.

vt
+11  A: 

Both Android and the iPhone have very strongly defined user interfaces. Even if you found a framework that bridged the huge differences on the most lower aspect levels (Android is programmed in Java on top of a custom VM, iPhone is native code programmed in Objective-C) and in the higher levels (iPhone apps are a completely sandboxed and isolated, the Android object model is distributed and classes are freely invoked between apps and libraries) your final app would feel alien and out of place in either of them. Think about the lack of multitouch in Android, or the lack of dedicated hardware buttons in the iPhone.

Your best bet would be to develop a platform specific user interface and have the model and core logic of your application in some kind of scripting language. Then find an interpreter in plain C (for the iPhone) and one in Java (for Android.) Scheme, Lisp and Javascript could fit the bill. Just make sure the interpreter is not exposed to end users or you would be violating the iPhone NDA...

If your app is data-heavy you could follow the model of many iPhone apps and develop native user interfaces for iPhone and Android, and have all the application logic in a remote server. Your UI becomes the only installed part of the application and everything else is hosted away on the net. This has the added advantage of having the possibility to offer roaming profiles between different devices and a web interface.

Carlos Carrasco
It appears that a number of solutions for this have become available since the question was initially asked.
Thomas
Some of the sentiment of this post may still be true (harnessing all the power of a particular piece of hardware) but if your app is simple enough there are a number of tools (linked in other answers) which can do the job.
Stimy
Good answer - but note that Android does have multitouch...
Roddy
+2  A: 

Mytopia has an unreleased framework called RUGS. They presented recently at TechCrunch 50 conference and their technology looked very interesting. They were able to compile an application that ran on all smartphone platforms (and was able to take advantage of the abilities of each... accelerometer on the iPhone for instance). Unfortunately their website says you need to email them if you want more information. Might be worth shooting them an email if you really want to develop on a cross platform smartphone targeted system.

I watched their presentation over the TC50 webcast, but unfortunately am not able to find a video for you now.

Please post back here with a summary of what framework you decide to use and why you chose it.

spoon16
+8  A: 

Phonegap is a javascript/css/html based framework that targets the iPhone, Android, and the Blackberry. It (on the iphone at least) can be bundled as a native app too.

http://phonegap.com/

Brad Parks
+1  A: 

I just wanted to mention that a web application using the Gears plugin can make use of Geolocation (GPS and Wifi location services) and this works on Android (the browser on the G1 ships with built-in Gears support).

I'm not sure if there's hope of getting gears support onto an iPhone, but it's another useful approach to building webapps with extra features while still having a wide reach of devices.

Mark Renouf
+2  A: 

Check out this:

http://www.xmlvm.org/overview/

It is a project that attempts to be able to cross-compile programs written in a variety of source languages to a variety of target languages. One of the initial test cases was to write programs in Java and run them on an iPhone. Watching the video on the site is worthwhile. They have discussed the possibility of being able to target Android as well.

With that said, I haven't tried it. The project seems quite beta, and there isn't a lot of activity on their SourceForge site.

+2  A: 

QuickConnectiPhone lets you write your app in JavaScript and yet it is still installable. An Android version is in unreleased Alpha at this point.

Having both would allow you to create your app in JavaScript, CSS, and HTML, make calls down to either the iPhone or the Android phone for device behaviors such as vibration, GPS locations, etc.

The iPhone version is downloadable from https://sourceforge.net/projects/quickconnect/ and if you contact me I can send you the Android version.

Lee
+5  A: 

Adding another service to the pile here: Rhomobile is looking to create just this. It does look quote dumbed-down -- think back to the web in the early 90's. But it could be the easiest way to port your fart app to every major mobile platform.

More details: Rhomobile promises: Build once, deploy to any smartphone

(Note: I don't work for Rhomobile; just came across the story today.)

pix0r
+1  A: 

we've had success with Ice-Touch middleware to have both iPhone and Android devices talking to same servers. with pretty decent code generation for network objects and methods. but local logic still has to be written in phone's language. this way we could leverage the UI advantages of each, while our model lives on the same server and our controllers are autogenerated.

link text

+3  A: 

I have no direct experience with iPhone or Android, but I just read an article about "Titanium" and then when I visited their site, found this:

http://www.appcelerator.com/products/titanium-mobile/

M. Esh.
A: 

Please check http://www.j2mepolish.org/cms/leftsection/introduction/janus.html, it is a great help in this area.

+3  A: 

Rhomobile's Rhodes framework does this. Rhodes apps are native for each individual smartphone

Adam Blum
+1  A: 

You can develop Java applications for IPhone with iSpectrum. This way you'll be able to re-use a consistent amount of your application code between Android and iPhone (and possibly desktop applets or J2ME MIDlets depending of what you do :) )

More infos at http://www.flexycore.com

Krusty
A: 

You should be aware of this before deciding on any code tools:

http://news.bbc.co.uk/1/hi/8616274.stm

Bob
A: 

the restrictions for multi platform tool on iphone has been removed : http://www.geek.com/articles/mobile/apple-relaxes-ios-development-tool-restrictions-app-review-guidelines-released-2010099/

amanieux antoine