Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
archive

GitHub Action

Consumable Code The Sport DB API

1.0.7

Consumable Code The Sport DB API

archive

Consumable Code The Sport DB API

Retrofit has been Handled, Consumable code for request Public API (TheSportDbApi)

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Consumable Code The Sport DB API

uses: caravancodes/[email protected]

Learn more about this action in caravancodes/consumable-code-the-sport-db-api

Choose a version

consumable-code-the-sport-db-api By AmirIsBack

  • v1.0.7 - Development
  • Stable Version

About This Project

Eliminates the method of retrieving json data using retrofit repeatedly. so this project has a set of functions to retrieve data without the need for fetching data using the retrofit of the API

Special From This Project

Simple code and reusable data

Screenshoot Apps

Version Release

This Is Latest Release

$version_release = 1.0.7

What's New??

* Fixing bug, adding null-able params, update build.gradle *

How To Use This Project

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
        // library consumable code the sport db api
        implementation 'com.github.amirisback:consumable-code-the-sport-db-api:1.0.7'
}

Step 3. Declaration ConsumeTheSportDbApi

val consumeTheSportDbApi = ConsumeTheSportDbApi("1") // "1" is API KEY

consumeTheSportDbApi.usingChuckInterceptor(this) // This is Code Chuck Interceptor

consumeTheSportDbApi.searchForPlayerByName(
    "Danny Welbeck",
    object : SportResultCallback<Players> {
        override fun getResultData(data: Players) {
            
            // * PLACE YOUR CODE HERE FOR UI / ARRAYLIST *

        }

        override fun failedResult(statusCode: Int, errorMessage: String?) {
            // failed result
        }

        override fun onShowProgress() {
            // showing your progress view
        }

        override fun onHideProgress() {
            // hiding your progress view
        }
    })

Fecthing Data Library

  • Retrofit
  • RxJava
  • OkHttp
  • Chuck Interceptor

Documentation THE SPORT DB API

https://www.thesportsdb.com/api.php

Function Main From This Project

// Switch For Using Chuck Interceptor
fun usingChuckInterceptor(context: Context)

// Search for team by name
fun searchForTeamByName(teamName: String?, sportResultCallback: SportResultCallback<Teams>)

// Search for team short code
fun searchForTeamByShortCode(shortCode: String?, sportResultCallback: SportResultCallback<Teams>)

// Search for all players from team *Patreon ONLY*
fun searchForAllPlayer(teamName: String?, sportResultCallback: SportResultCallback<Players>)

// Search for players by player name
fun searchForPlayer(playerName: String?, sportResultCallback: SportResultCallback<Players>)

// Search for players by player name and team name
fun searchForPlayer(playerName: String?, teamName: String?, sportResultCallback: SportResultCallback<Players>)

// Search for event by event name
fun searchForEvent(eventName: String?, sportResultCallback: SportResultCallback<Events>)

// Search For event by event name and season
fun searchForEvent(eventName: String?, season: String?, sportResultCallback: SportResultCallback<Events>)

// Search for event by event file name
fun searchForEventFileName(eventFileName: String?, sportResultCallback: SportResultCallback<Events>)

// List all sports
fun getAllSports(sportResultCallback: SportResultCallback<Sports>)

// List all leagues
fun getAllLeagues(sportResultCallback: SportResultCallback<Leagues>)

// List all Leagues in a country
fun searchAllLeagues(countryName: String?, sportResultCallback: SportResultCallback<Countrys>)

// List all Leagues in a country specific by sport
fun searchAllLeagues(countryName: String?, sportName: String?, sportResultCallback: SportResultCallback<Countrys>)

// List all Seasons in a League
fun searchAllSeasons(idTeam: String?, sportResultCallback: SportResultCallback<Seasons>)

// List all Teams in a League
fun searchAllTeam(league: String?, sportResultCallback: SportResultCallback<Teams>)

// List all Teams in Sportname & Country Name
fun searchAllTeam(sportName: String?, countryName: String?, sportResultCallback: SportResultCallback<Teams>)

// List All teams details in a league by Id
fun lookupAllTeam(idLeague: String?, sportResultCallback: SportResultCallback<Teams>)

// List All players in a team by Team Id *Patreon ONLY*
fun lookupAllPlayer(idTeam: String?, sportResultCallback: SportResultCallback<Players>)

// List all users loved teams and players
fun searchLoves(userName: String?, sportResultCallback: SportResultCallback<Users>)

// League Details by Id
fun lookupLeagues(idLeague: String?, sportResultCallback: SportResultCallback<Leagues>)

// Team Details by Id
fun lookupTeam(idTeam: String?, sportResultCallback: SportResultCallback<Teams>)

// Player Details by Id
fun lookupPlayer(idPlayer: String?, sportResultCallback: SportResultCallback<Players>)

// Event Details by Id
fun lookupEvent(idEvent: String?, sportResultCallback: SportResultCallback<Events>)

// Player Honours by Player Id
fun lookupHonour(idPlayer: String?, sportResultCallback: SportResultCallback<Honors>)

// Player Former Teams by Player Id
fun lookupFormerTeam(idPlayer: String?, sportResultCallback: SportResultCallback<FormerTeams>)

// Player Contracts by Player Id
fun lookupContract(idPlayer: String?, sportResultCallback: SportResultCallback<Contracts>)

// Lookup Table by League ID and Season
fun lookupTable(idLeague: String?, season: String?, sportResultCallback: SportResultCallback<Tables>)

// Next 5 Events by Team Id
fun eventsNext(idTeam: String?, sportResultCallback: SportResultCallback<Events>)

// Next 15 Events by League Id
fun eventsNextLeague(idLeague: String?, sportResultCallback: SportResultCallback<Events>)

// Last 5 Events by Team Id
fun eventsLast(idTeam: String?, sportResultCallback: SportResultCallback<Results>)

// Last 15 Events by League Id
fun eventsPastLeague(idLeague: String?, sportResultCallback: SportResultCallback<Events>)

// Events in a specific round by league id/round/season
fun eventsRound(idLeague: String?, round: String?, season: String?, sportResultCallback: SportResultCallback<Events>)

// All events in specific league by season (Free tier limited to 200 events)
fun eventsSeason(idLeague: String?, season: String?, sportResultCallback: SportResultCallback<Events>)

Android Library Version (build.gradle)

  • ext.kotlin_version = '1.3.70'
  • classpath 'com.android.tools.build:gradle:3.6.1'
  • compileSdkVersion 29
  • buildToolsVersion "29.0.3"
  • minSdkVersion 21

Colaborator

Very open to anyone, I'll write your name under this, please contribute by sending an email to me

  • Mail To [email protected]
  • Subject : Github _ [Github-Username-Account] _ [Language] _ [Repository-Name]
  • Example : Github_amirisback_kotlin_admob-helper-implementation

Name Of Contribute

  • Muhammad Faisal Amir
  • Waiting List
  • Waiting List

Waiting for your contribute

Attention !!!

Please enjoy and don't forget fork and give a star

  • Don't Forget Follow My Github Account
  • If you like this library, please help me / you can donate to buy patreon services