Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tolgatasci/scex

SoundCloud v2 Api Java Library
https://github.com/tolgatasci/scex

android api library soundcloud soundcloud-api v2

Last synced: 3 days ago
JSON representation

SoundCloud v2 Api Java Library

Awesome Lists containing this project

README

        

# SCex
SoundCloud v2 Api Java Library
## Install
Add it in your root build.gradle at the end of repositories:

allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}

}

Add the dependency

dependencies {
implementation 'com.github.tolgatasci:scex:2.1'
}

## Example Code

### Call Class
SCex yt = new SCex(getApplicationContext(),"cliend_id need");
# add user_id parametre api
SCex yt = new SCex(getApplicationContext(),"cliend_id need","sc_a_id parametre");

### Suggest
yt.Suggest("Suggest", new CallbackApi.ResData() {
@Override
public void data(ResponseQuery response) {
Log.e("work",response.getCollection().size() + "");
}
});

yt.Suggest("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### Tracks

# multiple id insert sample 7119603,93675143
yt.Tracks("7119603", new CallbackApi.ResData>() {
@Override
public void data(List response) {
Log.e("work",response.size()+ "");
}
});

yt.Tracks("7119603", (CallbackApi.ResData>) response -> Log.e("work",response.size()+ ""));
### Get File
yt.FileGet("url", new CallbackApi.ResData() {
@Override
public void data(ResponseDoc response) {
Log.e("work",response.getUrl() + "");
}
});

yt.FileGet("url", (CallbackApi.ResData) response -> Log.e("work",response.getUrl() + ""));

### Playlist
yt.Playlist(159147470, new CallbackApi.ResData() {
@Override
public void data(Playlist response) {
Log.e("work",response.getTitle()+ "");
}
});

yt.Playlist(159147470, (CallbackApi.ResData) response -> Log.e("work",response.getTitle()+ ""));

### Track Comments
yt.Comments(335233410, new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work",response.getCollection().get(0).getBody()+ "");
}
});
yt.Comments(335233410, (CallbackApi.ResData) response -> Log.e("work",response.getCollection().get(0).getBody()+ ""));

### User
yt.User(4816305, new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work",response.getCollection().get(0).getTrack().getTitle()+ "");
}
});
yt.User(4816305, (CallbackApi.ResData) response -> Log.e("work",response.getCollection().get(0).getTrack().getTitle()+ ""));

### Search
yt.Search("tarkan", new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work",response.getCollection().size() + "");
}
});
yt.Search("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### More every method
yt.more(response.getNextHref(), response, new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work 2",response.getCollection().size() + "");
}
});
yt.more(response.getNextHref(), response, (CallbackApi.ResData) response1 -> Log.e("work 2", response1.getCollection().size() + ""));
### Search Albums
yt.SearchAlbum("tarkan", new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work",response.getCollection().size() + "");
}
});
yt.SearchAlbum("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### Search Tracks
yt.SearchTracks("tarkan", new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {
Log.e("work",response.getCollection().size() + "");
}
});
yt.SearchTracks("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### Search Users
yt.SearchUser("tarkan", new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {

Log.e("work",response.getCollection().size() + "");
}
});
yt.SearchUser("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### Search Playlist
yt.SearchPlaylist("tarkan", new CallbackApi.ResData() {
@Override
public void data(SearchResponse response) {

Log.e("work",response.getCollection().size() + "");
}
});
yt.SearchPlaylist("tarkan", (CallbackApi.ResData) response -> Log.e("work",response.getCollection().size() + ""));

### Add Client ID
try {
// result https://www.domain.com/?client_id=example
String new_url = yt.add_client_id("https://www.domain.com/");
} catch (URISyntaxException e) {
e.printStackTrace();
}