Android lib to get the latest Ethiopian premier league data
## This project is no longer maintained! Checkout the node-js implementation.
Soccer Ethiopia API
This is an Android api that serve the latest Ethiopian premier league standing data
#### The data is fetched from Soccer Ethiopia. And this is an unoffical api.
follow the following steps to add the dependency to your app:
* make sure to add jitpack to your repositories
```gradle
allprojects {
repositories {
...
maven { url '
jitpack.io' }
}
}
```
* implement this lib
```gradle
dependencies {
implementation 'com.github.brookmg:Soccer-Ethiopia-API:0.6.0'
}
```
Samples
-------
* Initialising the library `With Caching`
```java
SoccerEthiopiaApi apiEntry = new SoccerEthiopiaApi(getApplicationContext()); //recommended to use application context
```
* Initialising the library `Without Caching`
```java
SoccerEthiopiaApi apiEntry = new SoccerEthiopiaApi(getApplicationContext(), false); //recommended to use application context
```
* And simply fetch the latest data from your activity or fragment like:
```java
apiEntry.getLatestTeamRanking(ranking -> {
for (RankItem item : ranking) {
Log.v("data" , item.getTeam().getTeamFullName() + ", " + item.getTeam().getTeamLogo() + ", " + item.getRank()
+ ", " + item.getPlayedGames() + ", " + item.getWonGames() + ", " + item.getDrawGames()
+ ", " + item.getLostGames()
);
}
},
error -> Log.e("Error" , error)
);
```
* Also you can get the league schedule data like:
```java
apiEntry.getLeagueSchedule(scheduleItems -> {
for (LeagueScheduleItem item : scheduleItems) {
Log.v("data_league" , item.getGameWeek() + " | " + item.getGameDetail() +
" | " + item.getGameDate() + " | " + item.getGameStatus());
}
}, error -> Log.e("Error_League" , error));
```
* Or for a specific game week (in this case the 5th game week):
```java
apiEntry.getLeagueSchedule( 5, scheduleItems -> {
for (LeagueScheduleItem item : scheduleItems) {
Log.v("data_league" , item.getGameWeek() + " | " + item.getGameDetail() +
" | " + item.getGameDate() + " | " …