Android programmatically retrieve license information from jar
<p>In our (Android / IOS) application we using various third party libraries, for example GSON (for Android). In IOS it is possible to read data from the POD (example license info) and display it within the app. </p>

<p>Is there a way to do something similar in Android / Gradle?</p>

<p>To clarify, using Gradle I compile in the following dependencies:</p>

<pre><code>compile 'com.koushikdutta.ion:ion:2.1.+'
compile 'com.google.code.gson:gson:2.6.+'
</code></pre>

<p>I'd like to have a screen in my application that shows the LICENSE files </p>

<p><a href="https://github.com/google/gson/blob/master/LICENSE" rel="nofollow noreferrer">https://github.com/google/gson/blob/master/LICENSE</a>
<a href="https://github.com/koush/ion/blob/master/LICENSE" rel="nofollow noreferrer">https://github.com/koush/ion/blob/master/LICENSE</a></p>

<p>The license retrieval need not happen within the app's Java code, it could be done at compile time, with this kind of logic inside Gradle:</p>

<p>for each dependency package
 check for LICENSE file
 concatenate LICENCE file into res/licenses.txt
endfor</p>

<p>in app, have some code to show licenses.txt (or licenses.xml if required)</p>