Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.beeptunes:agent:1.0.3'
}
dependencies {
implementation("com.github.beeptunes:agent:1.0.3")
}
<dependency>
<groupId>com.github.beeptunes</groupId>
<artifactId>agent</artifactId>
<version>1.0.3</version>
</dependency>
libraryDependencies += "com.github.beeptunes" % "agent" % "1.0.3"
:dependencies [[com.github.beeptunes/agent "1.0.3"]]
An interface to benefit Persian Music
To obtain your API key, contact us and after agreeing on a contract, we'll give you access to the archive.
build.gradle
)allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
build.gradle
)dependencies {
implementation 'com.github.beeptunes:Agent:1.0.0'
}
class App extends Application {
@Override
public void onCreate() {
super.onCreate();
Agent.init(this, YOUR_API_KEY);
}
}
You can make asynchronous calls by calling the Agent methods and giving it your desired callback.
For getting data for a track:
Agent.get().track((long) 503798065, new AgentCallback<Track>() {
@Override
public void onFailure (Call<Track> call, Throwable t) {
super.onFailure(call, t);
}
@Override
public void onResponse (Call<Track> call, Response<Track> response) {
super.onResponse(call, response);
Log.d(TAG, response.body().image);
}
});