An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Android Licenses Library
[![API](https://img.shields.io/badge/API-1%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=1)
[![HJitpack](https://jitpack.io/v/cyb3rko/android-licenses-library.svg)](https://jitpack.io/#cyb3rko/android-licenses-library)
[![last commit](https://img.shields.io/github/last-commit/cyb3rko/android-licenses-library?color=F34C9F)](https://github.com/cyb3rko/android-licenses-library/commits/master)
[![license](https://img.shields.io/github/license/cyb3rko/android-licenses-library)](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)