views:

87

answers:

2

I'm working in a Java-oriented shop and we're starting to adapt our products to mobile devices now (mainly focusing on smart phones). A separate native app is already in the works for the iPhone, but we would like to make a generic Java/J2ME version for any other devices.

My question is, how feasible is this? And where is the divergence point generally? ie We don't mind if each device has some variation in it's specific Java toolkit and they require separate builds, and thus all we can have is just have some basic framework stuff in common underneath. We're just trying to architect this in such a way that as much of the basic framework can be re-used as possible.

The main target platforms we're looking at are Android, Symbian, and generic Java-enabled mobile devices.

Anyone have any advice, pointers, or good links they can point me at?

+2  A: 

The biggest divergence point will be the UI. You will need an entirely seperate UI for an Android App vs. a J2ME app.

If your app does not depend on any hardware components, client side databases, etc. you should be able to reuse any other data model/ backend processing classes.

Mayra
+1  A: 

In my work we have a common Java code base that is used in J2ME, Android and BlackBerry and we have had to address some significant issues:

  • As Mayra says UI will be huge difference, so you are better off having different UI layers for J2ME and Android.
  • To make it compile for J2ME you will have to make your common code Java 1.3 compatible. This requires careful design, and nightly builds that compile for each of these platforms.
  • Because of the above reason we found it a good idea to write your application/game module in Java 1.3 compatible mode.
  • It also helps if you have a good release management system, because you now have common code for multiple platforms, so, versions, release planning, branching code and its impact on release, all these can become a major headache without careful handling.
  • If you are planning cross-platform compatibility in modules like C++ and its compatible Java application engine then do yourself a favor and write modules in human understandable format, for example write SaveData class, instead of SaveToRMS in J2ME and SaveFile in Symbian. That way you are encapsulating platform dependent implementation while making it easier for the developer to know whats happening in the class.
  • Lastly, know that it will take about 6-9 months for a framework like this to mature, so be patient, and good luck.
omermuhammed