https://github.com/cyb3rko/android-licenses-library
Lightweight Android library which provides most common licenses in formatted and plain text
https://github.com/cyb3rko/android-licenses-library
android attribution html kotlin legal library licenses licensing lightweight
Last synced: 8 months ago
JSON representation
Lightweight Android library which provides most common licenses in formatted and plain text
- Host: GitHub
- URL: https://github.com/cyb3rko/android-licenses-library
- Owner: cyb3rko
- License: apache-2.0
- Created: 2020-08-19T06:56:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-24T20:01:45.000Z (over 4 years ago)
- Last Synced: 2025-01-17T19:36:29.649Z (9 months ago)
- Topics: android, attribution, html, kotlin, legal, library, licenses, licensing, lightweight
- Language: HTML
- Homepage:
- Size: 3.76 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Licenses Library
[](https://android-arsenal.com/api?level=1)
[](https://jitpack.io/#cyb3rko/android-licenses-library)
[](https://github.com/cyb3rko/android-licenses-library/commits/master)
[](https://www.gnu.org/licenses/gpl-3.0.html)
- [About this project](#about-this-project)
- [Features](#feature)
- [How to use](#how-to-use)
- [Screenshots](#screenshots)
- [Contribute](#contribute)
- [Thanks](#thanks)
- [Apps using this library](#apps--libraries-using-this-library)
- [License](#license)
---
## About this project
This lightweight Android library provides the most common licenses in formatted and plain text (as [Spanned object](https://developer.android.com/reference/android/text/Spanned)) for easy use.
YOU CAN **DOWNLOAD** THE **SAMPLE APP** [HERE](https://github.com/cyb3rko/android-licenses-library/raw/master/.github//Sample%20App/AndroidLicensesSample%20v1.0.1.apk)
I'm still a student so the progress might not be as fast as on other projects.
## Feature
providing you the most common licenses in formatted and plain text form as Spanned objects
## How to use
### 1. Implementation
Add this to your **root** build.gradle file:
```gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
Then add this to your **module's** build.gradle file:
```gradle
dependencies {
implementation 'com.github.cyb3rko:android-licenses-library:lastest-version'
}
```
### 2. Initialize AndroidLicenses
```kotlin
AndroidLicenses.init(applicationContext)
```
### 3. Get Spanned Object
The method `get(licenseName)` needs the license name as a parameter and returns a Spanned object.
As the parameter you should use the predefined constants of `AndroidLicenses` class (which also show, which licenses are currently available):
- APACHE_2_0 / APACHE_2_0_PLAIN
- CC_BY_3_0 / CC_BY_3_0_PLAIN
- CC_BY_4_0 / CC_BY_4_0_PLAIN
- CC_BY_SA_3_0 / CC_BY_SA_3_0_PLAIN
- CC_BY_SA_4_0 / CC_BY_SA_4_0_PLAIN
- CC_BY_NC_3_0 / CC_BY_NC_3_0_PLAIN
- CC_BY_NC_SA_3_0 / CC_BY_NC_SA_3_0_PLAIN
- MIT / MIT_PLAIN
```kotlin
textView.setText(AndroidLicenses.get(AndroidLicenses.CC_BY_SA_4_0)
```
## Screenshots
Only the shown text belongs to the library, the ui is implemented in the sample app to showcase the Spanned objects.
|
|
|
|:---:|:---:|
## Contribute
Of course I'm happy about any kind of contribution.
Feel free to open [issues](https://github.com/cyb3rko/android-licenses-library/issues) for new features or bug reports.
If you want to directly contribute code just open [pull requests](https://github.com/cyb3rko/android-licenses-library/pulls).
## Thanks
Special thanks to reddit user [jderp7](https://www.reddit.com/user/jderp7/) for [contributing completely reworked library code](https://www.reddit.com/r/androiddev/comments/ipprkr/kotlin_companion_object_caching/), which was commited by me in [THIS COMMIT](https://github.com/cyb3rko/android-licenses-library/commit/eb42bac7c5a17bf6e0ee5318ef8bfc3c1e5f290f).
## Apps / Libraries using this library
*If you want to add an app/library here, just open a [new issue](https://github.com/cyb3rko/android-licenses-library/issues/new) / [PR](https://github.com/cyb3rko/android-licenses-library/compare).*
Click here to see the list
About Icons Library
by Cyb3rko
## License
```
Copyright (C) 2020 Cyb3rKo
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
```
`For details see` [License text](LICENSE)