Frage

I'm developing a Java Android app, I use some non-free components: Google Maps, Analytics, .. along with many open source (GPL'ed) packages. I want to be able to easily compile two releases:

  • Full Fledged with non-free [Upload to Market]
  • Limited but GPL'ed for the open-source community

I think Eclipse has some pre-processing powers, but this is not portable or standard.

What's the best practice for this case?

War es hilfreich?

Lösung

What's the best practice for this case?

There are three answers to this question.

The first answer is to consult with qualified legal counsel, along with relevant technologists, to determine if your plan will meet the GPL's requirements. IANAL, but if "full-fledged" contains GPL'd components, you cannot substitute some separate app's source code, even if some of that source code is the same, and claim that you are complying with the GPL, should somebody request the source to the "full-fledged" app. License term discussions are off-topic for StackOverflow, though if you have questions of "will such-and-so implementation satisfy this technical requirement (which happens to be imposed by the GPL)", feel free to ask those here.

The second answer is what zapl suggested in the comment, which is to consider Gradle for Android. The "product flavors" introduced in that build system make it comparatively easy to have one project that builds separate app versions for separate circumstances, such as:

  • Use separate in-app purchasing APIs for separate distribution channels (e.g., Play Store vs. Amazon AppStore for Android)

  • Use ARM vs. x86 NDK-compiled binaries

  • Use different ad networks

  • Etc.

However, while there are ways to have Eclipse and Gradle for Android get along, it would only be for projects that would not have different source code, resources, or manifest contents for the different product flavors. Otherwise, Eclipse will not be an option, at least today. Android Studio should be an option, though I have not tried using it to build product flavors. If you have not been using an IDE for builds, but instead have been using Ant, Gradle for Android pretty much supports a superset of Ant's capabilities today, even though it (and Android Studio) are still pre-release at this time.

In the absence of Gradle for Android, you could put common code in an Android library project and consume that library project from two apps.

Again, though, focus first on a solution that complies with the license terms, then determine the means by which you would implement the solution.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top