As a matter of courtesy, I would consider it appropriate to make a notation somewhere in your Github repository, to the effect of
This code uses [Library] which is licensed under the Apache 2.0 License, and can be obtained [here].
... irrespective of the licensing terms.
The Apache 2.0 license itself begins by defining some terms like "source," "object," "work" and "derived work." I won't repeat those definitions here, but suffice it to say that "source" means the source code, "object" means the executable library, "work" means the library in both source and object form, and "derived work" means a work that you have modified for your own purposes.
So, given that Apache defines "work" and "modified work" in terms of both source code and object code, the terms for redistribution are going to apply to both forms (i.e. the source code and the executable). This is further reinforced in the first paragraph of the Redistribution section, which states:
- Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
Naturally, if you're not actually redistributing, these terms would not apply. I would consider that possibility unlikely for your published Android app, since it's going to need an executable version of the library in question or it won't work.
Best Answer
The Apache License is a permissive license. It basically lets you do pretty much anything you want, as long as you tell people you used the software, and that it was Apache Licensed.
[I]f part of my application uses code I did not write ... under the Apache 2.0 license, am I not allowed to charge for my app?
No, it is perfectly ok to charge for your app. The Apache license does not prevent you from charging for applications that use Apache Licensed code.
From the license:
There is no mention in those conditions about charging or not charging money.
Do I have to release the source to my entire project?
No. The conditions from the license do not mention any requirement to release source.
What am I allowed to do and not allowed to do?
From the conditions:
I.e. you must include the license file with your application. (For binary applications, most people put this in a "terms of service" menu or some such.)
I.e. if you give someone the source, you must point out explicitly what was changed.
I.e. you cannot delete any license notices from the source package
I.e. if you have your own NOTICE file, you must include all license information from the original.
Other Licenses
Note that this applies to the Apache License. There is another very common license, the MIT license, that is functionally equivalent.
The other most common licenses are the GPL and the LGPL. Both of these licenses also let you charge money for applications generated, but different in that they both require you release source to users who you give binaries to, always for the GPL, under specific conditions for the LGPL.