java - What's the right design approach for writing an application for both Android and J2ME by maximizing code-reuse? -


most people asking migrating j2me android. i'm not. i'd develop applications , have them work on both android , j2me. each application have android project , j2me project , both source in shared dependent project have common code.

i'd know people think right design approach should maximize code reuse (maximize code in shared project).

in typical j2me application there controller/model , bunch of views.
each view holds reference controller , when user interacts view, view invokes method of controller , controller decides view should displayed next , data should have in it. views don't know each other. expect controller/model code should reusable if written properly.

the question is: how 1 controller many views translate android each activity performs subset of whole application?

one approach have single activity (the controller code in it).
means application have handle (as anyway j2me).
means when onaddcontextmenu called have know kind of page being displayed add page specific context menu.

another approach following: each application view becomes activity , model-controller passed around 1 activity another.

any opinions better? other approaches?

i suggested using lwuit framework. can develop android, blackberry , midlet based application small changes using lwuit. in android, cant use rms concept, pim api , jsr 172 , api's. have change things only. lwuit supports both touch , non-touch mobiles.

and 1 more info, can use pure java functionality on android platform. because java-me doesn't have map, set, arraylist, string functionality , etc. in android, can use of above. not necessary change reduce complexity of code.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -