Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcminarro/accedo-one-sdk-android
Accedo One SDK for Android.
https://github.com/jcminarro/accedo-one-sdk-android
Last synced: 11 days ago
JSON representation
Accedo One SDK for Android.
- Host: GitHub
- URL: https://github.com/jcminarro/accedo-one-sdk-android
- Owner: JcMinarro
- License: other
- Created: 2017-12-21T14:24:39.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T09:09:39.000Z (almost 7 years ago)
- Last Synced: 2024-10-05T10:41:00.303Z (about 1 month ago)
- Language: Java
- Size: 531 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Accedo One SDK for Android
```
_ _ ___
/_\ ___ ___ ___ __| | ___ /___\_ __ ___
//_\\ / __/ __/ _ \/ _` |/ _ \ // // '_ \ / _ \
/ _ \ (_| (_| __/ (_| | (_) | / \_//| | | | __/
\_/ \_/\___\___\___|\__,_|\___/ \___/ |_| |_|\___|```
## Summary
This is the official [Accedo One](https://www.accedo.tv/one) SDK for Android 4.0 and up, previously known as the VDK AppGrid component.
While Accedo One exposes a set of friendly REST APIs, this SDK is intended to provide a smoother experience when coding in Android, providing seamless sync/async services, with automatic caching, and offline mode.We follow [semantic versioning](http://semver.org/).
Check the [change log](./CHANGELOG.md) for a listing of changes and new features per version.## Features
The default factory exposed by this SDK allows creating a client instance tied to a device id and an application key. It provides the following features :
- Easy access to Accedo One APIs.
- Automatic session creation and re-creation.
- Automatic disk-caching for Control related data.
- Disk-cache auto-verified with if-modified-since calls whenever needed.
- Automatic and seamless fallback to cache versions of Control calls, whenever there's a service outage.
- Verbose logcat logging on what's going on at all times.
- Automatic pagination support for Publish calls.## Documentation
For the time being, please refer to the JavaDoc inside the definition file of all Services, that you can find here: [API docs](https://github.com/Accedo-Products/accedo-one-sdk-android/tree/master/one-sdk/src/main/java/tv/accedo/one/sdk/definition)
An exported and more detailed version coming soon!
You may also want to refer to the [Accedo One Rest API documentation](https://developer.one.accedo.tv/) that this SDK uses behind the scenes.
## Usage
Maven repository soon to come, please stand by! Until then you can just download the SDK binaries, and include them into your project manually. You can do that with the following steps:
- Copy the SDK binaries into your libs folder [from here](https://github.com/Accedo-Products/accedo-one-sdk-android/tree/master/binaries/1.0.0). Make sure you include sources and javadoc aswell.
- Apply it in your buildscript as a dependency:
```
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
implementation 'tv.accedo.one:one-sdk:1.0.0@aar'
}
```
- Create a singleton instance of AccedoOne in your service holder or application such as:```
static final AccedoOne accedoOne = new AccedoOneImpl("appKey", getDeviceId());
```- Use this instance to access AccedoOne anywhere!
## Examples
Below are a few examples on how to access certain parts of Accedo One via this SDK.### Using either sync or async accessors
The SDK provides you with both sync and async calls for almost every API it exposes. So if you want to just simply access some metadata, you can simply use the async ones, however if you'd like to embed some Accedo One calls into a larger initialisation process, you may find the sync ones to be more straightforward to use.
Sync example:
```
try {
String result = accedoOne.control().getMetadata(context, "base_url");
} catch (AccedoOneException e) {
e.printStackTrace();
}
```Async example:
```
Cancellable cancellable = accedoOne.control().async().getMetadata(context, "base_url", new Callback() {
@Override
public void execute(String result) {}
}, new Callback() {
@Override
public void execute(AccedoOneException result) {
}
});
```Please note the cancellable returned by async calls. Those can be useful if you'd like to cancel your calls on certain lifecycle events like onPause().
### Publish example
```
try {
JSONObject result = accedoOne.publish().getEntry(context, "hashId");
} catch (AccedoOneException e) {
e.printStackTrace();
}
```## More information & Links
* [Accedo One homepage](https://www.accedo.tv/one)
* [Accedo One help center](https://support.one.accedo.tv)
* [Accedo One API documentation](https://developer.one.accedo.tv)## Unit Tests
AndroidJUnitTests have been written to cover all of the exported APIs from this module. Async calls are auto-wrapped from sync ones, thus they are not tested separately.
## License
See the [LICENSE file](./LICENSE.md) for license rights and limitations (Apache 2.0)