I need to generate an Android application project with Java source code and XML layouts (modeling) – so actually I’m generating slightly modified default Android project (so no editing/transforming etc. just modeling from scratch).
It must be generated server-side, therefore I’m not interested in Eclipse-based plugins or something like that.
Is there a tool for it based on PHP?
If not, I suppose I should use FreeMarker or CodeModel (based on Java)?
Android projects are actually regular Java projects that use some special library and a different compiler (The Android’s Java Virtual machine, Dalvik, does not execute normal Java bytecode. It executes bytecode specific to it). So, most likely, you can use for this task any code-generation tool that is able to handle Java code (and maybe that is able to run Ant and GIT commands…).
For code generation, in general, almost every text-processing tool or language can be used. There are a few code generation tools written in Python, Ruby and Perl. Most likely, there will be one or more written in PHP. In some case it is even possible to use for code generation one of those template engines that are used in the web-dev world for generating HTML pages from HTML templates and PHP scripts.
The same is (almost) true for XML. You can use a normal “template engine” to generate XML from a template. Many template engines used in web-development explicitly support XML. Nevertheless, there are also others (maybe better, in any case more specific) tools to generate XML. Just Google around for “XML transformation tools”.