Is there a strategy or at least best practice to write an app that runs on iPhone, BlackBerry and Android?
I’m ignorant about the development environments for BB and Android, but I assume they both support Java apps.
I know that the iPhone would require an ObjectiveC portion (as well as a whole new UI).
Has anyone done this?
You might want to check out http://phonegap.com/
One technique, that works suitably for certain kinds of apps such as reference applications:
I wrote very small viewers that ran it off internally-stored HTML and images using jar:// (BlackBerry) and res:// (Windows Mobile) URL’s. I was able to embed all the HTML and images files as part of the BlackBerry application, by using a custom version of the browser field and . Same for Windows Mobile, I was able to use Pocket Internet Explorer as an embedded ActiveX in my Windows Mobile application.
Note — for BlackBerry, I had to support legacy devices running OS 4.2. To do so, I recycled a lot of RIM code samples, such as SecondaryResourceFetchThread.java to pull images embedded in the application, and deliver it to through a custom connection object that implemented HttpConnection that I designed to handle jar:// URL’s for internally embedded HTML/images in my BlackBerry application. It was a little tricky to figure out. For Windows Mobile, it was more intuitive.
There are other ways to do what I needed, but it worked perfectly for a medical reference application, and I was able to design separate CSS files for BlackBerry and for Windows Mobile to reformat the content slightly differently for the two mobile devices. (It was kind of like testing Netscape versus Internet Explorer compatibility in the old days.)
This may not work for your situation, but if your application is a web-style ‘reference’ application, and you know how to do HTML well, this approach may work.
We are currently looking into this also and we found:
These products have good reviews. The Titanium is free for the community edition.
Another option to look at is Rhodes, which is a Ruby framework.
http://j2mepolish.org could be good choice, however, iphone is only in the roadmap. But android and BB are already supported as well as all other j2me phones.
also if you’re writing games, check out my cross-platform (iPhone, Android, etc.) solution called the Cuttlefish Engine, at http://www.cuttlefishengine.com.
When writing multiplatform apps, you need to decide how much of the code to share. The 2 options are
- Everything. You use (write) cross platform gui libraries and system routines
- The logic is cross platform but the presentation layer is platform specific
The 2nd approach tends to give better apps but it is a more work (assuming you don’t need to write the cross platform libraries).
The tricky thing with the mobile world is picking a language. Right now you have
- Java: Android, Blackberry, Java ME phones
- Objective C/C: iPhone, windows Mobile
Also, you could give a try to Mobile Community Framework (MCF). This is a crossplatform framework running natively on iPhone, Android, WinMobile, Symbian and BlackBerry. MCF handles network, location and proximity operations for you, in a Wi-Fi Ad-Hoc network or through dedicated proxy server if no direct connection is possible. It has simple API, and it’s free to use. This way you can develop your app interface and logic separately on each platform, and use MCF to connect instances of your application in a way you like.
More info at http://uvamobiltec.com
Yet another framework is http://www.mosync.com/
It seems to support all major platforms.
Adobe Flex and Flash Builder looks promising too. Still you should consider its proprietary, but with the video on their developer center website seems like it worths it.
By the way, the latest release Currently supports Android. The support for iOS is supposed to be out in June 2011 through an update.