I am just curious about, what license should i use for app(android), i have written in my free time. I am using some libraries, which have this licenses on it:

  • Apache 2.0 license
  • MIT license
  • GNU Affero General Public License

1 Question: if i use this libraries, should my app be open source? I have no problem with making it open, but just not sure if i should do it. And if yes, what is the best of doing it? Just say it is open source, and that everyone can contact me for the source code? Or do i have to upload it somewhere (sourceforge, github)?

2 Question: if i use this libraries, am i able to sell my app? If not, am i able to make in app purchases to donate to me? As much i know the biggest problem would be the AGPL license. I use the library to create PDF files (iText). How should it be handled? Or can i make some features paid, but not that one, which are from the AGPL licensed library?

3 Question: what is the best license to use with my app in that case?


The usual line is that you are making a derivative work of all three libraries. When you distribute that, each individual component library must be redistributed under its original licence. The resulting derivative work - the whole product - must be distributed under a licence that honours them all.

Since one of the components is AGPL3, the resulting product must be distributed under a licence which is at least as permissive as the GPL - such a licence is referred to as being GPL-compatible. The FSF maintains a list of such licences, and Apache 2.0, the MIT X11 licence, and the MIT Expat licence (you do not say to which you refer) are compatible.

So as I understand it - and remember I am not a lawyer, and even if I were, I'm not your lawyer - you must release each component under its original licence, and the combined work under any one of the three (or, if you want to complicate matters, any other AGPL3-compatible licence).

You also ask

am i able to sell my app?

Yes, of course; free software may be sold, and often is. But you may not deprive your users of the four freedoms; in brief, you must provide them with the source code, and the rights to use it.

am i able to make in app purchases to donate to me?

Yes, you may; but you may not prevent other people from removing or altering that code.

As much i know the biggest problem would be the AGPL license. I use the library to create PDF files (iText). How should it be handled?

I don't entirely understand this part of the question.

Or can i make some features paid, but not that one, which are from the AGPL licensed library?

You may certainly charge for features, but when you distribute them to paying users, you must include full source, and the rights to use it, so that users may redistribute them if they wish.

Finally, I should add that not everyone agrees that linking your code to another's library makes a derivative work. You should get advice on this question, because if it doesn't, everything I wrote except the second sentence is false. However, most people that I know do not take this position; that is, they accept that linking creates a derivative work, and thus that such a derivative will be bound by all the licences on its components.

  • Thanks a lot for this detailed answer! Just to clear some little questions: I can sell the app, no matter what libraries i use (in my case the 3 above), but i have to make the app opensource and distribute it under atleast the GPL license? In that case i will not have problems with iText (AGPL license)? Cause they offer commercial license (about 2000bucks). Maybe litle bit offtopic, but what is the best way to provide my code to users? Thanks!
    – Wladislaw
    Mar 28 '16 at 10:38
  • 1
    In my opinion, the best way to provide your code to users is to distribute the combined work under AGPL3, making it clear that the components are still covered by their individual licences. This honours the licences on all the component libraries, and least-complicates the issue with an AGPL3 component.
    – MadHatter
    Mar 28 '16 at 10:41
  • 1
    This answer is incorrect! The AGPL is a viral license. When you use an AGPL library, the whole program needs to be licensed under AGPL. The GPL compatibility list works in the other direction: which licenses can be relicensed under the GPL. There is a special variant of the GPL, the LGPL, which allows to use the work as a library in a non-GPL project when it's linked dynamically, but I am not sure if the Android APK format even allows dynamic linking.
    – Philipp
    Mar 29 '16 at 8:26
  • I disagree. Please see my comment on your answer.
    – MadHatter
    Mar 29 '16 at 8:36

The AGPL is, just like the original GPL, a so-called "Viral License". When your program uses an AGPL library, then your whole program must be licensed under the AGPL. That means you must publish the sourcecode and you must give people permission to create and distribute derivative works under the AGPL.

See also the GPL FAQ about this:

Q: If a library is released under the GPL (not the LGPL), does that mean that any software which uses it has to be under the GPL or a GPL-compatible license?

A: Yes, because the software as it is actually run includes the library.

(technically this FAQ entry is about the GPL, not the AGPL, but the AGPL is an even stricter version of the GPL)

The sourcecode does not need to be part of the app, but when it is not, you must:

Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange;

Technically the AGPL does not prevent you from selling your app. Open source licenses do not forbid any money from changing hands. But unfortunately everyone who buys your app has the right to also sell your app or even give it away for free, so they can put your app onto the app store for free and there is nothing you can do about it.

Voluntary donations, on the other hand, can be a viable monetization model for open source.

  • 1
    You may believe that, but the FSF does not. Please note that I have linked to their statement on the subject ("If a library is released under the GPL, does that mean that any software which uses it has to be under the GPL or a GPL-compatible license? Yes.") in my answer. If you have some other authority to quote, please do so; but otherwise you may just be flaunting your prejudices.
    – MadHatter
    Mar 29 '16 at 8:35
  • 1
    You have quoted the FSF directly contradicting you in your own answer! Please, read the question, and the answer in their FAQ. It explicitly contradicts your claim that the entire derivative work must be licensed under GPL only; they are very clear that a GPL-compatible licence will suffice.
    – MadHatter
    Mar 29 '16 at 8:42
  • 1
    @MadHatter To summarize: This answer isn't exactly complete (you can offer licenses other than AGPL, if you have the ability to license them), but it's not exactly wrong, either (one of the possibly many licenses you offer for each component must be the AGPL). Philipp's statement, "your whole program must be licensed under the AGPL," appears to be technically correct under 5(c).
    – apsillers
    Apr 1 '16 at 15:46
  • 2
    @apsillers I think I see the point you're making, and it is a subtle and elegant one: the GPL's requirement to relicence under the GPL does not say that it must be only under the GPL, thus allowing more relaxed terms to also be offered. Do I have your point aright?
    – MadHatter
    Apr 1 '16 at 16:06
  • 2
    @MadHatter Yes, exactly: my understanding is that, at the time you distribute a work that includes a GPL-licensed component, the entire work -- at the moment of distribution -- becomes licensed under the GPL, even if you don't normally license other parts of the work that way. (Not a lawyer; I'm sure this could be articulated more precisely.) This fact does not impede your ability to distribute the other parts with a more permissive license simultaneously (per the "does not invalidate such permission" provision).
    – apsillers
    Apr 1 '16 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.