tags:

views:

78

answers:

1

I got a application for android which downloads and parses some data from a internet-source. Nothing special here. But, I need the application for two difference source, with slightliy different source-code. Currently there are simply two applications in the AndroidManifest and two slightly different Activites, which override a big abstract class containing all the similar things. This works without any problems, I get two applications, just as I expected.

Now, I want to build two APK's to upload them to the Market, each should contain one of the Applications, and each of the applications must be seperate installable (and even both at the same time). The only solution which came to my mind was to create two new projects (with two new AndroidManifest) and symlink the original source-folder to the two new projects. However, this also leads into problems, as it is forbidden to install two applications which got the same package (in terms of java-package 'de.dbruhn.app'). See this thread on the Mailinglist

Is there a working solution?

Thanks!

+1  A: 

This is exactly what the "library" mechanism is for. Make your original project into a library project, and then have two different projects that reference the library project. Each one will have it's own Manifest file, and can declare its own package name (which will identify it on the android market) and set of declared activities and filters.

Note that neither of the new projects needs to contain any source code at all. They can simply reference Activities in the library project (using absolute path names if necessary to deal with package differences).

beekeeper
Thanks, works like a charm, exactlly what I was searching for!
theomega