정훈용

API changed

Showing 218 changed files with 173 additions and 5 deletions
...@@ -36,12 +36,11 @@ android { ...@@ -36,12 +36,11 @@ android {
36 36
37 dependencies { 37 dependencies {
38 implementation fileTree(dir: 'libs', include: ['*.jar']) 38 implementation fileTree(dir: 'libs', include: ['*.jar'])
39 - implementation 'androidx.appcompat:appcompat:1.1.0' 39 + implementation 'androidx.appcompat:appcompat:1.0.2'
40 implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 40 implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
41 testImplementation 'junit:junit:4.12' 41 testImplementation 'junit:junit:4.12'
42 - androidTestImplementation 'androidx.test.ext:junit:1.1.1' 42 + androidTestImplementation 'androidx.test.ext:junit:1.1.0'
43 - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 43 + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
44 - //implementation 'com.google.code.gson:gson:2.8.5' 44 + implementation 'com.google.code.gson:gson:2.8.5'
45 //implementation 'com.squareup.okhttp3:okhttp:3.9.0' 45 //implementation 'com.squareup.okhttp3:okhttp:3.9.0'
46 - implementation 'com.github.taycaldwell:riot-api-java:4.3.0'
47 } 46 }
......
This diff is collapsed. Click to expand it.
1 +Manifest-Version: 1.0
2 +Sealed: true
3 +
1 +# [RIOT-API-JAVA](http://taycaldwell.com/riot-api-java/)
2 +----------
3 +[![JitPack](https://img.shields.io/github/tag/rithms/riot-api-java.svg?label=maven)](https://jitpack.io/#taycaldwell/riot-api-java/4.3.0)
4 +----------
5 +
6 +A simple to use Riot Games API wrapper for Java.
7 +This library makes it easy to gather and use League of Legends data in your apps.
8 +
9 +## Disclaimer
10 +This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates.
11 +
12 +## Requirements
13 +
14 +**riot-api-java** requires Java 7 and the following libraries:
15 +- [Google Gson](https://code.google.com/p/google-gson/)
16 +
17 +## Setup
18 +
19 +[Download](https://github.com/taycaldwell/riot-api-java/releases) the .jar file, and add it as an external library to your project.
20 +
21 +If you are using Eclipse, this can be done by right clicking your project, and selecting:
22 +
23 +Build Path -> Configure Build Path -> Libraries -> Add External Jars
24 +
25 +and selecting the jar under the Order and Export tab.
26 +
27 +This project is also available on [Jitpack](https://jitpack.io/#rithms/riot-api-java/4.3.0)
28 +
29 +### Gradle
30 +
31 +Add Jitpack to your root build.gradle at the end of repositories:
32 +
33 +```java
34 +allprojects {
35 + repositories {
36 + ...
37 + maven { url 'https://jitpack.io' }
38 + }
39 +}
40 +```
41 +
42 +Add the project as a dependency:
43 +
44 +```java
45 +dependencies {
46 + compile 'com.github.taycaldwell:riot-api-java:4.3.0'
47 +}
48 +```
49 +
50 +### Maven
51 +
52 +Add Jitpack as a repository:
53 +
54 +```xml
55 +<repositories>
56 + <repository>
57 + <id>jitpack.io</id>
58 + <url>https://jitpack.io</url>
59 + </repository>
60 +</repositories>
61 +```
62 +
63 +Add the project as a dependency:
64 +
65 +```xml
66 +<dependency>
67 + <groupId>com.github.taycaldwell</groupId>
68 + <artifactId>riot-api-java</artifactId>
69 + <version>4.2.0</version>
70 +</dependency>
71 +```
72 +
73 +## Usage
74 +
75 +This library can be used strictly according to the [Riot API Documentation](https://developer.riotgames.com/api/methods) like so:
76 +
77 +```java
78 +import net.rithms.riot.api.ApiConfig;
79 +import net.rithms.riot.api.RiotApi;
80 +import net.rithms.riot.api.RiotApiException;
81 +import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
82 +import net.rithms.riot.constant.Platform;
83 +
84 +/**
85 + * This example demonstrates using the RiotApi to request summoner information for a given summoner name
86 + */
87 +public class SummonerExample {
88 +
89 + public static void main(String[] args) throws RiotApiException {
90 + ApiConfig config = new ApiConfig().setKey("YOUR-API-KEY-HERE");
91 + RiotApi api = new RiotApi(config);
92 +
93 + Summoner summoner = api.getSummonerByName(Platform.NA, "tryndamere");
94 + System.out.println("Name: " + summoner.getName());
95 + System.out.println("Summoner ID: " + summoner.getId());
96 + System.out.println("Account ID: " + summoner.getAccountId());
97 + System.out.println("PUUID: " + summoner.getPuuid());
98 + System.out.println("Summoner Level: " + summoner.getSummonerLevel());
99 + System.out.println("Profile Icon ID: " + summoner.getProfileIconId());
100 + }
101 +}
102 +```
103 +
104 +It is important to be aware of your personal rate limit. Any method call from the Riot API is a request that counts towards your rate limit, except requests regarding static data which count toward a method rate limit but not toward your app rate limit. The below code makes 2 requests; one request for a summoner, and another for the match list of a summoner.
105 +
106 +```java
107 +import net.rithms.riot.api.ApiConfig;
108 +import net.rithms.riot.api.RiotApi;
109 +import net.rithms.riot.api.RiotApiException;
110 +import net.rithms.riot.api.endpoints.match.dto.MatchList;
111 +import net.rithms.riot.api.endpoints.match.dto.MatchReference;
112 +import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
113 +import net.rithms.riot.constant.Platform;
114 +
115 +/**
116 + * This example demonstrates using the RiotApi to request the match list for a given summoner name and iterating over the match list
117 + */
118 +public class MatchListExample {
119 +
120 + public static void main(String[] args) throws RiotApiException {
121 + ApiConfig config = new ApiConfig().setKey("YOUR-API-KEY-HERE");
122 + RiotApi api = new RiotApi(config);
123 +
124 + // First we need to request the summoner because we will need it's account ID
125 + Summoner summoner = api.getSummonerByName(Platform.NA, "tryndamere");
126 +
127 + // Then we can use the account ID to request the summoner's match list
128 + MatchList matchList = api.getMatchListByAccountId(Platform.NA, summoner.getAccountId());
129 +
130 + System.out.println("Total Games in requested match list: " + matchList.getTotalGames());
131 +
132 + // We can now iterate over the match list to access the data
133 + if (matchList.getMatches() != null) {
134 + for (MatchReference match : matchList.getMatches()) {
135 + System.out.println("GameID: " + match.getGameId());
136 + }
137 + }
138 + }
139 +}
140 +```
141 +
142 +You can find these and more examples in the repository's directory "examples".
143 +
144 +## Documentation
145 +The documentation for this library can be found [here.](http://taycaldwell.com/riot-api-java/doc/)
146 +
147 +## API Versions
148 +The current version of this library supports the following Riot Games API versions:
149 +- **CHAMPION-MASTERY-V4**
150 +- **CHAMPION-V3**
151 +- **LEAGUE-V4**
152 +- **LOL-STATUS-V3**
153 +- **MATCH-V4**
154 +- **SPECTATOR-V4**
155 +- **STATIC-DATA-V3** (deprecated)
156 +- **SUMMONER-V4**
157 +- **THIRD-PARTY-CODE-V4**
158 +- **TOURNAMENT-V3**
159 +- **TOURNAMENT-STUB-V4**
160 +
161 +## Contributing
162 +All contributions are appreciated.
163 +If you would like to contribute to this project, please send a pull request.
164 +
165 +## Contact
166 +Have a suggestion, complaint, or question? Open an [issue](https://github.com/taycaldwell/riot-api-java/issues).
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.