views:

47

answers:

1

Hi there, I'd like to bring out an Android app in the near future, so I was wondering how to support a couple of funcitonalities I have got used whilst developing for J2ME and iPhone

  • first the versioning. With J2ME (using NetBeans as IDE) I had the option to auto-increment the softwwares version every time I compiled it. I was wondering if something like this is available for Eclipse and if so how to use it ?
  • secondly a common code base. Is it possible to have a common code base for several projects ? For example I might have a game which actually uses the same code but needs different graphic resources. I'd hate to have a different project for every game/app and have to manually edit every project's source every time I want to submit a new code-change. Any solution for this ?

Thanks in advance for every kind of help/hints/tips !

A: 

Another idea:

If you can package the common code into Classes then a library approach would help. In eclipse under project properties you can add a library to your project.

Hope this helps you on.

PaulF
that I already tried but it's too complex for me as in it might take several weeks to create a library containing all the code (about 4000 lines of code in about 30 classes)...
TiGer
creating a library would seem like the reasonable thing to do. However I'm not sure why moving some part of your code would be so tedious. Unless all the different libraries are absolutely compatible you will have to customize the UI part at least, possibly more, of your application to suit the different needs. For example the program structure in Android is very different from the program structure in J2ME. Thus a set of library projects would be your application logic and shared code and then separate projects would integrate these in working applications for the different platforms
Newtopian
it does sound like a lot of work said like that but in the long run you will find it actually helps reduce the burden of maintenance where each project focuses on a single aspect of your structure. Should a bug arise identifying which aspect is defective should be relatively easy and fixing the problem will not impact the other parts. this separation should yield a more stable whole while not duplicating the code needlessly. I would be happy to help you separating the code in smaller libraries as the scope of this task should be measured in hours rather than weeks
Newtopian
well let's say that apart from the pretty independent Activties and stuff I am also using like a management layer which keeps track of all those and does a lot of other stuff as well... Placing this in a library to me it would make it too much "static". Don't know why but I'm not getting a good feeling about all the library thing :P
TiGer