정훈용

specific classes added

Showing 255 changed files with 387 additions and 611 deletions
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4"> 2 <project version="4">
3 <component name="VcsDirectoryMappings"> 3 <component name="VcsDirectoryMappings">
4 - <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
5 - <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
6 <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> 4 <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
7 </component> 5 </component>
8 </project> 6 </project>
...\ No newline at end of file ...\ No newline at end of file
......
1 apply plugin: 'com.android.application' 1 apply plugin: 'com.android.application'
2 2
3 android { 3 android {
4 - packagingOptions {
5 - exclude 'META-INF/proguard/androidx-annotations.pro'
6 - }
7 - packagingOptions {
8 - exclude 'META-INF/DEPENDENCIES'
9 - exclude 'META-INF/LICENSE'
10 - exclude 'META-INF/LICENSE.txt'
11 - exclude 'META-INF/license.txt'
12 - exclude 'META-INF/NOTICE'
13 - exclude 'META-INF/NOTICE.txt'
14 - exclude 'META-INF/notice.txt'
15 - exclude 'META-INF/ASL2.0'
16 - }
17 -
18 -
19 compileSdkVersion 29 4 compileSdkVersion 29
20 buildToolsVersion "29.0.2" 5 buildToolsVersion "29.0.2"
21 defaultConfig { 6 defaultConfig {
...@@ -36,11 +21,9 @@ android { ...@@ -36,11 +21,9 @@ android {
36 21
37 dependencies { 22 dependencies {
38 implementation fileTree(dir: 'libs', include: ['*.jar']) 23 implementation fileTree(dir: 'libs', include: ['*.jar'])
39 - implementation 'androidx.appcompat:appcompat:1.0.2' 24 + implementation 'androidx.appcompat:appcompat:1.1.0'
40 implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 25 implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
41 testImplementation 'junit:junit:4.12' 26 testImplementation 'junit:junit:4.12'
42 - androidTestImplementation 'androidx.test.ext:junit:1.1.0' 27 + androidTestImplementation 'androidx.test.ext:junit:1.1.1'
43 - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 28 + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
44 - implementation 'com.google.code.gson:gson:2.8.5'
45 - //implementation 'com.squareup.okhttp3:okhttp:3.9.0'
46 } 29 }
......
1 - Apache License
2 - Version 2.0, January 2004
3 - http://www.apache.org/licenses/
4 -
5 - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 -
7 - 1. Definitions.
8 -
9 - "License" shall mean the terms and conditions for use, reproduction,
10 - and distribution as defined by Sections 1 through 9 of this document.
11 -
12 - "Licensor" shall mean the copyright owner or entity authorized by
13 - the copyright owner that is granting the License.
14 -
15 - "Legal Entity" shall mean the union of the acting entity and all
16 - other entities that control, are controlled by, or are under common
17 - control with that entity. For the purposes of this definition,
18 - "control" means (i) the power, direct or indirect, to cause the
19 - direction or management of such entity, whether by contract or
20 - otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 - outstanding shares, or (iii) beneficial ownership of such entity.
22 -
23 - "You" (or "Your") shall mean an individual or Legal Entity
24 - exercising permissions granted by this License.
25 -
26 - "Source" form shall mean the preferred form for making modifications,
27 - including but not limited to software source code, documentation
28 - source, and configuration files.
29 -
30 - "Object" form shall mean any form resulting from mechanical
31 - transformation or translation of a Source form, including but
32 - not limited to compiled object code, generated documentation,
33 - and conversions to other media types.
34 -
35 - "Work" shall mean the work of authorship, whether in Source or
36 - Object form, made available under the License, as indicated by a
37 - copyright notice that is included in or attached to the work
38 - (an example is provided in the Appendix below).
39 -
40 - "Derivative Works" shall mean any work, whether in Source or Object
41 - form, that is based on (or derived from) the Work and for which the
42 - editorial revisions, annotations, elaborations, or other modifications
43 - represent, as a whole, an original work of authorship. For the purposes
44 - of this License, Derivative Works shall not include works that remain
45 - separable from, or merely link (or bind by name) to the interfaces of,
46 - the Work and Derivative Works thereof.
47 -
48 - "Contribution" shall mean any work of authorship, including
49 - the original version of the Work and any modifications or additions
50 - to that Work or Derivative Works thereof, that is intentionally
51 - submitted to Licensor for inclusion in the Work by the copyright owner
52 - or by an individual or Legal Entity authorized to submit on behalf of
53 - the copyright owner. For the purposes of this definition, "submitted"
54 - means any form of electronic, verbal, or written communication sent
55 - to the Licensor or its representatives, including but not limited to
56 - communication on electronic mailing lists, source code control systems,
57 - and issue tracking systems that are managed by, or on behalf of, the
58 - Licensor for the purpose of discussing and improving the Work, but
59 - excluding communication that is conspicuously marked or otherwise
60 - designated in writing by the copyright owner as "Not a Contribution."
61 -
62 - "Contributor" shall mean Licensor and any individual or Legal Entity
63 - on behalf of whom a Contribution has been received by Licensor and
64 - subsequently incorporated within the Work.
65 -
66 - 2. Grant of Copyright License. Subject to the terms and conditions of
67 - this License, each Contributor hereby grants to You a perpetual,
68 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 - copyright license to reproduce, prepare Derivative Works of,
70 - publicly display, publicly perform, sublicense, and distribute the
71 - Work and such Derivative Works in Source or Object form.
72 -
73 - 3. Grant of Patent License. Subject to the terms and conditions of
74 - this License, each Contributor hereby grants to You a perpetual,
75 - worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 - (except as stated in this section) patent license to make, have made,
77 - use, offer to sell, sell, import, and otherwise transfer the Work,
78 - where such license applies only to those patent claims licensable
79 - by such Contributor that are necessarily infringed by their
80 - Contribution(s) alone or by combination of their Contribution(s)
81 - with the Work to which such Contribution(s) was submitted. If You
82 - institute patent litigation against any entity (including a
83 - cross-claim or counterclaim in a lawsuit) alleging that the Work
84 - or a Contribution incorporated within the Work constitutes direct
85 - or contributory patent infringement, then any patent licenses
86 - granted to You under this License for that Work shall terminate
87 - as of the date such litigation is filed.
88 -
89 - 4. Redistribution. You may reproduce and distribute copies of the
90 - Work or Derivative Works thereof in any medium, with or without
91 - modifications, and in Source or Object form, provided that You
92 - meet the following conditions:
93 -
94 - (a) You must give any other recipients of the Work or
95 - Derivative Works a copy of this License; and
96 -
97 - (b) You must cause any modified files to carry prominent notices
98 - stating that You changed the files; and
99 -
100 - (c) You must retain, in the Source form of any Derivative Works
101 - that You distribute, all copyright, patent, trademark, and
102 - attribution notices from the Source form of the Work,
103 - excluding those notices that do not pertain to any part of
104 - the Derivative Works; and
105 -
106 - (d) If the Work includes a "NOTICE" text file as part of its
107 - distribution, then any Derivative Works that You distribute must
108 - include a readable copy of the attribution notices contained
109 - within such NOTICE file, excluding those notices that do not
110 - pertain to any part of the Derivative Works, in at least one
111 - of the following places: within a NOTICE text file distributed
112 - as part of the Derivative Works; within the Source form or
113 - documentation, if provided along with the Derivative Works; or,
114 - within a display generated by the Derivative Works, if and
115 - wherever such third-party notices normally appear. The contents
116 - of the NOTICE file are for informational purposes only and
117 - do not modify the License. You may add Your own attribution
118 - notices within Derivative Works that You distribute, alongside
119 - or as an addendum to the NOTICE text from the Work, provided
120 - that such additional attribution notices cannot be construed
121 - as modifying the License.
122 -
123 - You may add Your own copyright statement to Your modifications and
124 - may provide additional or different license terms and conditions
125 - for use, reproduction, or distribution of Your modifications, or
126 - for any such Derivative Works as a whole, provided Your use,
127 - reproduction, and distribution of the Work otherwise complies with
128 - the conditions stated in this License.
129 -
130 - 5. Submission of Contributions. Unless You explicitly state otherwise,
131 - any Contribution intentionally submitted for inclusion in the Work
132 - by You to the Licensor shall be under the terms and conditions of
133 - this License, without any additional terms or conditions.
134 - Notwithstanding the above, nothing herein shall supersede or modify
135 - the terms of any separate license agreement you may have executed
136 - with Licensor regarding such Contributions.
137 -
138 - 6. Trademarks. This License does not grant permission to use the trade
139 - names, trademarks, service marks, or product names of the Licensor,
140 - except as required for reasonable and customary use in describing the
141 - origin of the Work and reproducing the content of the NOTICE file.
142 -
143 - 7. Disclaimer of Warranty. Unless required by applicable law or
144 - agreed to in writing, Licensor provides the Work (and each
145 - Contributor provides its Contributions) on an "AS IS" BASIS,
146 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 - implied, including, without limitation, any warranties or conditions
148 - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 - PARTICULAR PURPOSE. You are solely responsible for determining the
150 - appropriateness of using or redistributing the Work and assume any
151 - risks associated with Your exercise of permissions under this License.
152 -
153 - 8. Limitation of Liability. In no event and under no legal theory,
154 - whether in tort (including negligence), contract, or otherwise,
155 - unless required by applicable law (such as deliberate and grossly
156 - negligent acts) or agreed to in writing, shall any Contributor be
157 - liable to You for damages, including any direct, indirect, special,
158 - incidental, or consequential damages of any character arising as a
159 - result of this License or out of the use or inability to use the
160 - Work (including but not limited to damages for loss of goodwill,
161 - work stoppage, computer failure or malfunction, or any and all
162 - other commercial damages or losses), even if such Contributor
163 - has been advised of the possibility of such damages.
164 -
165 - 9. Accepting Warranty or Additional Liability. While redistributing
166 - the Work or Derivative Works thereof, You may choose to offer,
167 - and charge a fee for, acceptance of support, warranty, indemnity,
168 - or other liability obligations and/or rights consistent with this
169 - License. However, in accepting such obligations, You may act only
170 - on Your own behalf and on Your sole responsibility, not on behalf
171 - of any other Contributor, and only if You agree to indemnify,
172 - defend, and hold each Contributor harmless for any liability
173 - incurred by, or claims asserted against, such Contributor by reason
174 - of your accepting any such warranty or additional liability.
175 -
176 - END OF TERMS AND CONDITIONS
177 -
178 - APPENDIX: How to apply the Apache License to your work.
179 -
180 - To apply the Apache License to your work, attach the following
181 - boilerplate notice, with the fields enclosed by brackets "[]"
182 - replaced with your own identifying information. (Don't include
183 - the brackets!) The text should be enclosed in the appropriate
184 - comment syntax for the file format. We also recommend that a
185 - file or class name and description of purpose be included on the
186 - same "printed page" as the copyright notice for easier
187 - identification within third-party archives.
188 -
189 - Copyright [yyyy] [name of copyright owner]
190 -
191 - Licensed under the Apache License, Version 2.0 (the "License");
192 - you may not use this file except in compliance with the License.
193 - You may obtain a copy of the License at
194 -
195 - http://www.apache.org/licenses/LICENSE-2.0
196 -
197 - Unless required by applicable law or agreed to in writing, software
198 - distributed under the License is distributed on an "AS IS" BASIS,
199 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 - See the License for the specific language governing permissions and
201 - limitations under the License.
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).
1 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2 - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 - <modelVersion>4.0.0</modelVersion>
4 -
5 - <groupId>com.github.rithms</groupId>
6 - <artifactId>riot-api-java</artifactId>
7 - <version>4.3.0</version>
8 -
9 - <properties>
10 - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11 - </properties>
12 -
13 - <build>
14 - <sourceDirectory>src/main/java</sourceDirectory>
15 - <plugins>
16 - <plugin>
17 - <groupId>org.apache.maven.plugins</groupId>
18 - <artifactId>maven-compiler-plugin</artifactId>
19 - <version>3.2</version>
20 - <configuration>
21 - <source>1.7</source>
22 - <target>1.7</target>
23 - </configuration>
24 - </plugin>
25 - <plugin>
26 - <groupId>org.apache.maven.plugins</groupId>
27 - <artifactId>maven-source-plugin</artifactId>
28 - <version>2.2.1</version>
29 - <executions>
30 - <execution>
31 - <id>attach-sources</id>
32 - <phase>package</phase>
33 - <goals>
34 - <goal>jar</goal>
35 - </goals>
36 - </execution>
37 - </executions>
38 - </plugin>
39 - </plugins>
40 - </build>
41 -
42 - <dependencies>
43 - <dependency>
44 - <groupId>com.google.code.gson</groupId>
45 - <artifactId>gson</artifactId>
46 - <version>2.5</version>
47 - </dependency>
48 -
49 - <dependency>
50 - <groupId>junit</groupId>
51 - <artifactId>junit</artifactId>
52 - <version>4.12</version>
53 - <scope>test</scope>
54 - </dependency>
55 - </dependencies>
56 -
57 -</project>
1 +package com.example.pro_lol_log;
2 +
3 +import android.content.Context;
4 +
5 +import androidx.test.platform.app.InstrumentationRegistry;
6 +import androidx.test.ext.junit.runners.AndroidJUnit4;
7 +
8 +import org.junit.Test;
9 +import org.junit.runner.RunWith;
10 +
11 +import static org.junit.Assert.*;
12 +
13 +/**
14 + * Instrumented test, which will execute on an Android device.
15 + *
16 + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17 + */
18 +@RunWith(AndroidJUnit4.class)
19 +public class ExampleInstrumentedTest {
20 + @Test
21 + public void useAppContext() {
22 + // Context of the app under test.
23 + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 +
25 + assertEquals("com.example.pro_lol_log", appContext.getPackageName());
26 + }
27 +}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.example.pro_lol_log"> 3 package="com.example.pro_lol_log">
4 4
5 - <uses-permission android:name="android.permission.INTERNET"/> 5 + <uses-permission android:name="android.permission.INTERNET" />
6 6
7 <application 7 <application
8 android:allowBackup="true" 8 android:allowBackup="true"
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
19 <category android:name="android.intent.category.LAUNCHER" /> 19 <category android:name="android.intent.category.LAUNCHER" />
20 </intent-filter> 20 </intent-filter>
21 </activity> 21 </activity>
22 - <activity android:name=".Player_Pro_Analysis" />
23 </application> 22 </application>
24 23
25 </manifest> 24 </manifest>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -31,21 +31,14 @@ import android.view.animation.AnimationUtils; ...@@ -31,21 +31,14 @@ import android.view.animation.AnimationUtils;
31 31
32 32
33 import android.os.AsyncTask; 33 import android.os.AsyncTask;
34 - 34 +/*
35 import com.google.gson.Gson; 35 import com.google.gson.Gson;
36 import com.google.gson.GsonBuilder; 36 import com.google.gson.GsonBuilder;
37 import com.google.gson.JsonElement; 37 import com.google.gson.JsonElement;
38 import com.google.gson.JsonParser; 38 import com.google.gson.JsonParser;
39 - 39 +*/
40 import java.net.HttpURLConnection; 40 import java.net.HttpURLConnection;
41 41
42 -import okhttp3.HttpUrl;
43 -import okhttp3.OkHttpClient;
44 -import okhttp3.Request;
45 -import okhttp3.Response;
46 -
47 -
48 -
49 public class MainActivity extends AppCompatActivity { 42 public class MainActivity extends AppCompatActivity {
50 43
51 44
...@@ -78,7 +71,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -78,7 +71,7 @@ public class MainActivity extends AppCompatActivity {
78 TextView [] Proname = new TextView[2]; 71 TextView [] Proname = new TextView[2];
79 72
80 //일반 정보------- 73 //일반 정보-------
81 - PlayAnalysis mine; 74 + Player_info mine;
82 //검색 대상 정보------ 75 //검색 대상 정보------
83 76
84 77
...@@ -240,9 +233,6 @@ public class MainActivity extends AppCompatActivity { ...@@ -240,9 +233,6 @@ public class MainActivity extends AppCompatActivity {
240 //시작 시 mode 0로 보여주기 233 //시작 시 mode 0로 보여주기
241 mode0(); 234 mode0();
242 235
243 - MyAsyncTask mProcessTask = new MyAsyncTask();
244 - mProcessTask.execute();
245 -
246 236
247 } 237 }
248 238
...@@ -550,81 +540,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -550,81 +540,7 @@ public class MainActivity extends AppCompatActivity {
550 } 540 }
551 } 541 }
552 //외부 연결용 TASK가 필요하다. 542 //외부 연결용 TASK가 필요하다.
553 - public class MyAsyncTask extends AsyncTask<String, Void,PlayAnalysis> { 543 + //public class MyAsyncTask extends AsyncTask<String, Void,PlayAnalysis> {
554 - ProgressDialog progressDialog = new ProgressDialog(MainActivity.this);
555 -
556 - //OkHttp 객체생성
557 - OkHttpClient client = new OkHttpClient();
558 -
559 - @Override
560 - protected void onPreExecute() {
561 - super.onPreExecute();
562 - progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
563 - progressDialog.setMessage("\t로딩중...");
564 - //show dialog
565 - progressDialog.show();
566 - }
567 -
568 - @Override
569 - protected PlayAnalysis doInBackground(String... params) {
570 -
571 - //파라미터를 더해 주거나 authentication header를 추가할 수 있다.
572 -
573 - HttpUrl.Builder urlBuilder = HttpUrl.parse("https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/Cuzz?api_key=RGAPI-f3a35288-26a1-46c3-96fd-697863811e8a").newBuilder();
574 - //urlBuilder.addQueryParameter("key","430156241533f1d058c603178cc3ca0e");
575 - //urlBuilder.addQueryParameter("targetDt","20170908");
576 - String url = urlBuilder.build().toString();
577 -
578 - Request request = new Request.Builder()
579 - .url(url)
580 - .build();
581 -
582 - try {
583 - Response response = client.newCall(request).execute();
584 -
585 - //여기서 해야 하나???
586 - //gson을 이용해서 json을 자바 객체로 변환한다.
587 - Gson gson = new GsonBuilder().create();
588 - JsonParser parser = new JsonParser();
589 - //제공되는 오픈API데이터에서 어떤 항목을 가여올지 설정해야 하는데.... 음~
590 - JsonElement rootObject = parser.parse(response.body().charStream())
591 - .getAsJsonObject().get("boxOfficeResult").getAsJsonObject().get("dailyBoxOfficeList"); //원하는 항목(?)까지 찾아 들어가야 한다.
592 - PlayAnalysis posts = gson.fromJson(rootObject, PlayAnalysis.class);
593 -
594 - return posts;
595 - } catch (Exception e) {
596 - e.printStackTrace();
597 - }
598 - return null;
599 - }
600 -
601 - @Override
602 - protected void onPostExecute(PlayAnalysis result) {
603 - super.onPostExecute(result);
604 - progressDialog.dismiss();
605 - //요청결과를 여기서 처리한다. 화면에 출력하기등...
606 -
607 - //아니면 여기서 해야 하나? JSON 오브젝트로 변환하기
608 -
609 - String imp33 = result.get_all();
610 - Toast.makeText(MainActivity.this, imp33, Toast.LENGTH_SHORT).show();
611 -
612 - /*
613 - if(result.length > 0){
614 - for (MovieItem post: result){
615 -// Log.d(TAG, String.valueOf(post.getRank()));//랭킹
616 -// Log.d(TAG, post.getMovieNm());//영화제목 출력
617 -// Log.d(TAG, post.getOpenDt());//개봉일 출력
618 - tv_result.append(String.valueOf(post.getRank())+"\n");
619 - tv_result.append(post.getMovieNm()+"\n");
620 - tv_result.append(post.getOpenDt()+"\n");
621 - }
622 - }
623 - */
624 -
625 - }
626 - }
627 - //새롭게 추가한 함수는 꽤 길다...
628 544
629 545
630 546
......
1 +package com.example.pro_lol_log;
2 +
3 +public class Match_info {
4 +
5 + //이게 매치 정보이다.
6 + int gameId;
7 +
8 + int gameDuration;
9 + int timePenalty1; //시간 값 받아올 때 산출한다.
10 + int timePenalty2; // 후반 지표를 위해 큰 배수 적용
11 + int lane = 0 ;
12 + // 1탑 2정글 3미드 4봇 5서폿
13 + int tierH = 50;
14 + int tierL = 40;
15 + // 챌150 그마140 마130 다120 플110 골100 실90 브80 아70 (임의)
16 + // 챌30 그마28 마26 다24 플22 골20 실18 브16 아14 언랭14(실제 높은 값)
17 + // 챌30 그마29 마28 다27 플26 골25 실24 브23 아22 언랭22(실제 낮은 값)
18 + // 9 8 7 6 5 4 3 2 1 0
19 + // 일반은 아이언하고 같이 측정한다.
20 +
21 + // 대상이 되는 유저 아이디
22 + int Id_num = -1;
23 + //0 ~ 9
24 + //사실상은 1~10
25 +
26 + //시야 관련 점수----------------
27 + //int totalVision = 0;
28 + int visionScore ; //long
29 + int wardsPlaced ;
30 + int wardsKilled ;
31 + int visionWardsBoughtInGame ;
32 +
33 + //성장 관련---------------------
34 + int champLevel;
35 + int goldEarned;
36 + int totalMinionKilled;
37 + /*
38 + int [] champLevel = new int[10];
39 + int [] goldEarned = new int[10];
40 + int [] totalMinionKilled = new int[10];
41 + */
42 +
43 +
44 + //활약 관련---------------------
45 + int kills;
46 + int deaths;
47 + int assists;
48 +
49 + boolean firstBloodAssist;
50 + boolean firstBloodkill;
51 +
52 + int largestMultiKill; // 최대 멀티 킬
53 + int doubleKills;
54 + int tripleKills;
55 + int quadraKills;
56 + int pentakills;
57 + /*
58 + int [] kills = new int[10];
59 + int [] assists = new int[10];
60 +
61 + boolean [] firstBloodAssis = new boolean[10];
62 + boolean [] firstBloodkill= new boolean[10];
63 +
64 + int [] largestMultiKill = new int[10]; // 최대 멀티 킬
65 + int [] doubleKills = new int[10];
66 + int [] tripleKills = new int[10];
67 + int [] quadraKills = new int[10];
68 + int [] pentakills = new int[10];
69 + */
70 + //전투기여도-------------------------
71 + int totalTimeCrowdContrlDealt; // 군중제어 횟수
72 + int totalDamageDealt; // 준 데미지 long totalDamageDealtToChampions 를 받아야 한다.
73 + int damageSelfMitigated;// 데미지 경감량 long
74 + int totalDamageTaken; // 받은 데미지 long
75 + /*
76 + int [] totalTimeCrowdContrlDealt = new int[10]; // 군중제어 횟수
77 + int [] totalDamageDealt = new int[10]; // 준 데미지 long
78 + int [] damageSelfMitigated = new int[10];// 데미지 경감량 long
79 + int [] totalDamageTaken = new int[10]; // 받은 데미지 long
80 + */
81 +
82 +
83 + public int Penalty1(int time){
84 + //int val;
85 + int result;
86 + if (time < 900){
87 + result = time*10;
88 + }
89 + else if (time < 1200){
90 + result = (900*10) + (11*(time-900));
91 + }
92 + else if (time < 1500){
93 + result = (900*10) + (300*11)+(12*(time-1200));
94 + }
95 + else if (time < 1800){
96 + result = (900*10) + (300*11)+(300*12)+(14*(time-1500));
97 + }
98 + else{
99 + result = (900*10) + (300*11)+(300*12)+(300*14) + (16*(time-1800));
100 + }
101 + int val = (int)(result / 100); //이러면 100 수준 으로 떨어진다.
102 + return val;
103 + }
104 +
105 + public int Penalty2(int time){
106 + //int val;
107 + int result;
108 + if (time < 900){
109 + result = time*10;
110 + }
111 + else if (time < 1200){
112 + result = (900*10) + (12*(time-900));
113 + }
114 + else if (time < 1500){
115 + result = (900*10) + (300*12)+(14*(time-1200));
116 + }
117 + else if (time < 1800){
118 + result = (900*10) + (300*12)+(300*14)+(17*(time-1500));
119 + }
120 + else{
121 + result = (900*10) + (300*12)+(300*14)+(300*17) + (20*(time-1800));
122 + }
123 + int val = (int)(result / 100); //이러면 100 수준 으로 떨어진다.
124 + return val;
125 + }
126 +
127 +
128 + //json 파싱을 통해 인수를 넣는다.------------------
129 + public void analysis(){}
130 + //-----------------------------------------------------
131 +
132 + //점수는 티어 상대값과 절대값으로 제공
133 + //type 0 절대값 type 1 티어 상대값
134 + //절대값을 100을 곱한다.
135 + public int sightscore(int type){
136 +
137 + int imp = 0;
138 + imp = visionScore + wardsPlaced + wardsKilled + visionWardsBoughtInGame * 2;
139 + imp = imp*10;
140 + if (type == 1) {
141 + imp = imp * tierL;
142 + }
143 + else if (type == 0){
144 + imp = imp * 10;
145 + }
146 + else {
147 + imp = 0;
148 + }
149 + imp = (int) imp / timePenalty1;
150 + return imp;
151 +
152 + }
153 +
154 + public int growthscore(int type) {
155 + int imp = 0;
156 + //int goldEarned;
157 + //int totalMinionKilled;
158 + imp = champLevel*400 + goldEarned;
159 +
160 +
161 + if (type == 1) {
162 + imp = imp * tierL;
163 + }
164 + else if (type == 0){
165 + imp = imp * 10;
166 + }
167 + else {
168 + imp = 0;
169 + }
170 + imp = (int) imp / timePenalty1;
171 + return imp;
172 + }
173 +
174 + public int actscore(int type,int line) {
175 + int imp = 0;
176 + /*
177 + int kills;
178 + int deaths;
179 + int assists;
180 +
181 + boolean firstBloodAssis;
182 + boolean firstBloodkill;
183 +
184 + int largestMultiKill; // 최대 멀티 킬
185 + int doubleKills;
186 + int tripleKills;
187 + int quadraKills;
188 + int pentakills;
189 + */
190 + //라인 별로 달라진다. 1탑 ~ 5서폿
191 + if (line == 1)
192 + {
193 + imp = kills*320 - deaths*150 + assists*100;
194 + imp = imp + 50*doubleKills + 100*tripleKills + 200*quadraKills+500*pentakills;
195 + if ((firstBloodAssist || firstBloodkill)==true)
196 + {
197 + imp = imp+150;
198 + }
199 + }
200 + else if(line == 2)
201 + {
202 + imp = kills*270 - deaths*170 + assists*130;
203 + imp = imp + 70*doubleKills + 150*tripleKills + 250*quadraKills+600*pentakills;
204 + if ((firstBloodAssist || firstBloodkill)==true)
205 + {
206 + imp = imp+150;
207 + }
208 + }
209 + else if(line == 3)
210 + {
211 + imp = kills*300 - deaths*200 + assists*100;
212 + imp = imp + 50*doubleKills + 100*tripleKills + 200*quadraKills+500*pentakills;
213 + if ((firstBloodAssist || firstBloodkill)==true)
214 + {
215 + imp = imp+200;
216 + }
217 + }
218 + else if(line == 4)
219 + {
220 + imp = kills*400 - deaths*300 + assists*60;
221 + imp = imp + 50*doubleKills + 100*tripleKills + 200*quadraKills+500*pentakills;
222 + if ((firstBloodAssist || firstBloodkill)==true)
223 + {
224 + imp = imp+200;
225 + }
226 + }
227 + else if(line == 5)
228 + {
229 + imp = kills*200 - deaths*100 + assists*150;
230 + imp = imp + 50*doubleKills + 250*tripleKills + 500*quadraKills+1000*pentakills;
231 + if ((firstBloodAssist || firstBloodkill)==true)
232 + {
233 + imp = imp+200;
234 + }
235 + }
236 + else {
237 + imp = 0;
238 + }
239 + if (imp <= 0){
240 + imp = 0;
241 + }
242 +
243 + if (type == 1) {
244 + imp = imp * tierH;
245 + }
246 + else if (type == 0){
247 + imp = imp * 10;
248 + }
249 + else {
250 + imp = 0;
251 + }
252 + imp = (int) imp / timePenalty2;
253 + return imp;
254 + }
255 +
256 + public int battlecontribution(int type, int line){
257 + int imp = 0;
258 + /*
259 + int totalTimeCrowdContrlDealt; // 군중제어 횟수
260 + int totalDamageDealt; // 준 데미지 long
261 + int damageSelfMitigated;// 데미지 경감량 long
262 + int totalDamageTaken; // 받은 데미지 long
263 + */
264 + if (line == 1)
265 + {
266 + imp = totalDamageDealt*5 + totalDamageTaken*3 + damageSelfMitigated*1;
267 + }
268 + else if(line == 2){
269 + imp = totalDamageDealt*4 + totalDamageTaken*3 + damageSelfMitigated*1;
270 + }
271 + else if(line == 3){
272 + imp = totalDamageDealt*5 + totalDamageTaken*3 + damageSelfMitigated*1;
273 + }
274 + else if(line == 4){
275 + imp = totalDamageDealt*7 + totalDamageTaken*2 + damageSelfMitigated*1;
276 + }
277 + else if(line == 5){
278 + imp = totalDamageDealt*4 + totalDamageTaken*4 + damageSelfMitigated*2;
279 + }
280 + else{
281 + imp = 0;
282 + }
283 +
284 + if (type == 1) {
285 + imp = imp * tierH;
286 + }
287 + else if (type == 0){
288 + imp = imp * 10;
289 + }
290 + else {
291 + imp = 0;
292 + }
293 + imp = (int) imp / timePenalty2;
294 + return imp;
295 +
296 + }
297 +
298 +
299 +
300 +
301 +}
1 -package com.example.pro_lol_log;
2 -
3 -import java.io.BufferedReader;
4 -import java.io.InputStreamReader;
5 -import java.net.HttpURLConnection;
6 -import java.net.URL;
7 -
8 -import javax.net.ssl.HttpsURLConnection;
9 -
10 -
11 -public class OpenAPI {
12 -
13 - /*
14 - public void API_read(){
15 - BufferedReader br = null;
16 - try {
17 - String urlstr = "https://kr.api.riotgames.com/lol/"+"summoner/v4/summoners/by-name/"
18 - + "?api_key=RGAPI-51a0a882-6247-460b-bd0a-654b51e751f8";
19 - URL url = new URL(urlstr);
20 - HttpsURLConnection urlconnection = (HttpsURLConnection) url.openConnection();
21 -
22 -
23 - }catch(Exception e){
24 -
25 - }
26 -
27 -
28 - }
29 -*/
30 -
31 -}
1 -package com.example.pro_lol_log;
2 -
3 -public class PlayAnalysis {
4 -
5 - //이 3가지를 중점으로 테스트하자
6 - String name;
7 - long summonerLevel;
8 - String accountId;
9 -
10 - String get_all(){
11 - return name+" / "+summonerLevel+" / "+accountId;
12 - }
13 -
14 - /*
15 - int tire;
16 - // 0 없음 1 언랭 2 아이언 3 브론즈 4 실버 5 골드 6 플래티넘 7다이아몬드 8마스터 9그랜드마스터 10챌린저
17 - int rank;
18 - // 1~4
19 - int win;
20 - int loss;
21 -
22 - String acct_ID;
23 - //String enc_ID;
24 -
25 - // 매치 스탬프 검사
26 - long matches[] = new long[20];
27 -
28 - public void read_match(int count, long match)
29 - {
30 - matches[count]=match;
31 - }
32 - */
33 -}
1 -package com.example.pro_lol_log;
2 -
3 -public class Player_Pro_Analysis {
4 -}
1 +package com.example.pro_lol_log;
2 +
3 +public class Player_info {
4 +
5 +
6 + //이 3가지를 중점으로 테스트하자 정보는
7 + String name;
8 + long summonerLevel;
9 + String accountId;
10 +
11 +
12 +
13 + String get_all(){
14 + return name+" / "+summonerLevel+" / "+accountId;
15 + }
16 +
17 + /*
18 + int tire;
19 + // 0 없음 1 언랭 2 아이언 3 브론즈 4 실버 5 골드 6 플래티넘 7다이아몬드 8마스터 9그랜드마스터 10챌린저
20 + int rank;
21 + // 1~4
22 + int win;
23 + int loss;
24 +
25 + String acct_ID;
26 + //String enc_ID;
27 +
28 + // 매치 스탬프 검사
29 + long matches[] = new long[20];
30 +
31 + public void read_match(int count, long match)
32 + {
33 + matches[count]=match;
34 + }
35 + */
36 +}
37 +
38 +
1 +package com.example.pro_lol_log;
2 +
3 +public class Pro_info {
4 +
5 + String name;
6 + String accountId;
7 + String [] matches = new String[30];
8 +
9 +}
...@@ -22,3 +22,4 @@ ...@@ -22,3 +22,4 @@
22 22
23 <color name="transparent">#00000000</color> 23 <color name="transparent">#00000000</color>
24 </resources> 24 </resources>
25 +
......
...@@ -100,5 +100,5 @@ ...@@ -100,5 +100,5 @@
100 </style> 100 </style>
101 101
102 102
103 -
104 </resources> 103 </resources>
104 +
......
...@@ -8,11 +8,9 @@ buildscript { ...@@ -8,11 +8,9 @@ buildscript {
8 } 8 }
9 dependencies { 9 dependencies {
10 classpath 'com.android.tools.build:gradle:3.5.1' 10 classpath 'com.android.tools.build:gradle:3.5.1'
11 - //implementation 'com.google.code.gson:gson:2.8.5'
12 11
13 // NOTE: Do not place your application dependencies here; they belong 12 // NOTE: Do not place your application dependencies here; they belong
14 // in the individual module build.gradle files 13 // in the individual module build.gradle files
15 - //implementation 'com.squareup.okhttp3:okhttp:3.9.0'
16 } 14 }
17 } 15 }
18 16
...@@ -20,6 +18,7 @@ allprojects { ...@@ -20,6 +18,7 @@ allprojects {
20 repositories { 18 repositories {
21 google() 19 google()
22 jcenter() 20 jcenter()
21 +
23 } 22 }
24 } 23 }
25 24
......
1 -#Sun Dec 01 23:09:52 KST 2019 1 +#Thu Dec 05 23:39:18 KST 2019
2 distributionBase=GRADLE_USER_HOME 2 distributionBase=GRADLE_USER_HOME
3 distributionPath=wrapper/dists 3 distributionPath=wrapper/dists
4 zipStoreBase=GRADLE_USER_HOME 4 zipStoreBase=GRADLE_USER_HOME
......