정훈용

API added

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -36,10 +36,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.code.gson:gson:2.8.5'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//implementation 'com.google.code.gson:gson:2.8.5'
//implementation 'com.squareup.okhttp3:okhttp:3.9.0'
implementation 'com.github.taycaldwell:riot-api-java:4.3.0'
}
......
package com.example.pro_lol_log;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.pro_lol_log", appContext.getPackageName());
}
}
......@@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pro_lol_log">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
......
......@@ -28,7 +28,13 @@ import android.widget.Toast;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.google.gson.Gson;
//드디어 롤 관련 API
import net.rithms.riot.api.ApiConfig;
import net.rithms.riot.api.RiotApi;
import net.rithms.riot.api.RiotApiException;
import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
import net.rithms.riot.constant.Platform;
public class MainActivity extends AppCompatActivity {
......@@ -521,14 +527,7 @@ public class MainActivity extends AppCompatActivity {
}
}
//본격적인 분석
public void APIuses(){
Gson gson = new Gson();
//아래와 같은 식으로 사용한다.
// gson.fromJson()
}
......
package com.example.pro_lol_log;
import net.rithms.riot.api.ApiConfig;
import net.rithms.riot.api.RiotApi;
import net.rithms.riot.api.RiotApiException;
import net.rithms.riot.api.endpoints.summoner.dto.Summoner;
import net.rithms.riot.constant.Platform;
public class Player_Pro_Analysis {
ApiConfig config = new ApiConfig().setKey("RGAPI-f3a35288-26a1-46c3-96fd-697863811e8a");
RiotApi api = new RiotApi(config);
//Summoner summoner = api.getSummonerByName(Platform.KR, "hide on bush");
/*
System.out.println("Name: " + summoner.getName());
System.out.println("Summoner ID: " + summoner.getId());
System.out.println("Account ID: " + summoner.getAccountId());
System.out.println("PUUID: " + summoner.getPuuid());
System.out.println("Summoner Level: " + summoner.getSummonerLevel());
System.out.println("Profile Icon ID: " + summoner.getProfileIconId());
*/
}
......
......@@ -4,7 +4,7 @@ buildscript {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
......@@ -12,6 +12,7 @@ buildscript {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
//implementation 'com.squareup.okhttp3:okhttp:3.9.0'
}
}
......@@ -19,6 +20,7 @@ allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
......