lbry-android-sdk/README.md

51 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2020-02-20 12:35:04 +01:00
# LBRY Android SDK
2020-02-20 12:38:38 +01:00
[![pipeline status](https://ci.lbry.tech/lbry/lbry-android-sdk/badges/master/pipeline.svg)](https://ci.lbry.tech/lbry/lbry-android-sdk/commits/master)
2020-02-20 12:35:04 +01:00
[![GitHub license](https://img.shields.io/github/license/lbryio/lbry-android-sdk)](https://github.com/lbryio/lbry-android/blob/master/LICENSE)
2020-02-20 12:35:04 +01:00
The LBRY SDK packaged as an Android AAR library which can be used in any Android Studio project.
2018-06-30 13:25:57 +02:00
## Installation
2020-02-20 12:35:04 +01:00
No installation required as this is a dev library.
2017-08-13 03:24:00 +02:00
## Usage
2020-02-20 12:35:04 +01:00
1. Open your project in Android Studio.
1. File > New > New Module...
1. Select Import .JAR / .AAR Package and click Next
2020-02-20 12:37:52 +01:00
1. Select the `lbrysdk-<version>-<debug|release>.aar` package from the location you built or downloaded it to where `version` is the sdk version and `<debug|release>` is either `debug` or `release`.
2020-02-20 12:35:04 +01:00
1. Click Finish
2020-02-20 12:37:52 +01:00
1. Add `implementation project(':lbrysdk-<version>-<debug|release>')` to the `build.gradle` configuration for the main app module.
2020-02-20 12:35:04 +01:00
### Using the SDK
Add the `FOREGROUND_SERVICE` and `INTERNET` permissions to `AndroidManifest.xml` if they are not yet added.
```
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" />
```
Add the `android:usesCleartextTraffic="true"` attribute to the `application` tag in `AndroidManifest.xml`.
Import the required classes to be able to start up the service.
```
import io.lbry.lbrysdk.LbrynetService;
import io.lbry.lbrysdk.ServiceHelper;
```
Add code to launch the service.
```
Context context = getApplicationContext();
ServiceHelper.start(context, "", LbrynetService.class, "lbrynetservice");
```
2017-08-13 03:24:00 +02:00
## Running from Source
2020-02-20 12:35:04 +01:00
The library can be built from source using [Buildozer](https://github.com/lbryio/buildozer). After cloning the repository, copy `buildozer.spec.sample` to `buildozer.spec` and modify this file as necessary for your environment. Please see [BUILD.md](BUILD.md) for detailed build instructions.
2017-08-13 03:24:00 +02:00
## Contributing
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
2017-08-13 03:24:00 +02:00
## License
This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
2017-08-13 03:24:00 +02:00
## Security
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it.
2017-08-13 03:24:00 +02:00
## Contact
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)