Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, so now that i have some experience developing an app for both platforms (actually 2 apps for each platform) i can answer my own question. first of all, i must point out that the differences between the platforms are not just the UI. there are a lot of things that are done differently, for example Bluetooth, localization, notifications, storage, etc'.</p> <p>1) i used a single controller that switches among many views but i think, the android way is better, in other words, the controller should be broken up into smaller sub-controolers, so it corresponds more to the android's activities. This ensures that only the code that is needed is triggered rather than having all the controller in memory when the app is active.<br> 2) i used source linking rather than project dependencies. Each of my application is a project which pulls in several source folders (using linked sources). An Android app for example points to an android platform impl folder, a generic platform folder, an android bluetooth impl folder, an generic bluetooth folder, an Android Storage impl folder, a generic storage folder, a generic controller folder and an andtroid specific controller folder, and similarly for storage... (J2me app pulls in all the generic folders but pulls in the J2me folders rather than the android folders) each source folder contains several packages... 3) i use Factories, so i have android factories which implement generic interfaces that create android objects (which come from android source folders) and j2me factories that create j2me objects (which come from j2me source folders) and of course all objects created implement generic interfaces (that come from generic source folders) 4) i learned how to handle Bluetooth, notification, storage, etc' in each platform, and the fun part was to abstract the different way you do things in each of the platforms into a generic abstract way that applies to both platforms.</p> <p>The advantages of doing it this way (source linking) are:<br> 1) i have all the projects/applications in the same workspace (i now have a family of j2me applications and another of android applications). i can see all the common code in every project and i can modify it easily while working on some project and obviously it immediately affects all other projects that it uses.<br> 2) refactoring works very well too. i can easily move classes from one source folder to another.<br> 3) What's interesting about doing it this way is that normally programmers write a base class and specialize it in sub-classes. But by linking in different source code you can have some class extending two different super-classes. In other words, i can have class X extend class Y, but in two different projects class Y is different. this allows me to have two different platform specific base-classes for the same generic class... (this must be very confusing to the reader)</p> <p>so even though each one of my projects links to common code and unique code all my sources are in one place and each project binaries are in the project's space. so a common .class file may be duplicated in each project that uses them. so what abstracted all the work into generic abstract classes and my controller deals with them. The abstract classes are usually implemented in a platform specific manner transparent to my abstract/generic controller. </p> <p>well, sorry that this answer is very abstract so let me give one more concrete example:<br> so now i have for example something called BluetoothController. it's an abstract entity that has an implementation in J2ME and android. in the future, if i need to use Bluetooth in a new android project, i just pull in the generic code and the android-specific code for Bluetooth. similarly for j2me if i want to develop a midlet. my reusable component is composed of generic and platform-specific entities. </p> <p>I hope this answer provides some help for people who are trying to develop an app for both J2ME and android (or some other future Java platform)<br> if you have any questions, you can try contacting me...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload