08-20-2024, 09:05 AM
(This post was last modified: 08-20-2024, 09:58 AM by TheSportsDBFan.)
JVM based TheSportsDB HTTP API client to connect to the api of https://thesportsdb.com/
Download: Github: https://github.com/Biacode/jsportsdb
Developer: Arthur
Github Profile: https://github.com/Biacode
Java Example:
Kotlin Example:
Download: Github: https://github.com/Biacode/jsportsdb
Developer: Arthur
Github Profile: https://github.com/Biacode
Java Example:
Code:
public class JavaDemoApp {
public static void main(String[] args) {
final SearchTeamClient searchTeamClient = new SearchTeamClientImpl();
final ResultResponse searchTeamResult = searchTeamClient.byShortCode("Ars");
System.out.println(searchTeamResult.asMap());
System.out.println(searchTeamResult.asString());
final ListSportsClient listSportsClient = new ListSportsClientImpl();
final ResultResponse listSportsResult = listSportsClient.all();
System.out.println(listSportsResult.asMap());
System.out.println(listSportsResult.asString());
}
}
Kotlin Example:
Code:
object KotlinDemoApp {
@JvmStatic
fun main(args: Array<String>) {
val searchTeamResult = SearchTeamClientImpl().byShortCode("Arsenal")
println(searchTeamResult.asString())
println(searchTeamResult.asMap())
val listSportsResult = ListSportsClientImpl().all()
println(listSportsResult.asString())
println(listSportsResult.asMap())
}
}