NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

public void readGameIn() {
StringRequest stringRequest = new StringRequest(Request.Method.GET, URL_READ, new Response.Listener<String>() {
@Override
public void onResponse(String response) {

try {
JSONObject root = new JSONObject(response);
JSONArray matches = root.getJSONArray("matches");

for(int i = 0; i<10; i++) {

JSONObject jsonObject1 = matches.getJSONObject(i);

int gameId = jsonObject1.getInt("gameId");
champion = jsonObject1.getInt("champion");
permaTimeStamp = jsonObject1.getLong("timestamp");
String role = jsonObject1.getString("role");
String lane = jsonObject1.getString("lane");

readGameOut(gameId, permaTimeStamp, champion);


}
} catch (JSONException e) {
Log.e("Hata", e.getMessage());
e.printStackTrace();
}

}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {

}
});

Volley.newRequestQueue(getContext()).add(stringRequest);
}

private void readGameOut(int gameId, final long permaTimeStamp, final int champion) {
final String gameOutQuery = "https://tr1.api.riotgames.com/lol/match/v4/matches/" + gameId + "?api_key=RGAPI-09009ca1-9c2f-4629-af0f-a5687c0b09ef";

StringRequest stringRequest = new StringRequest(Request.Method.GET, gameOutQuery, new Response.Listener<String>() {

@Override
public void onResponse(String response) {
int tempParticipantId;
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("participantIdentities");

for(int i = 0; i<jsonArray.length(); i++){

JSONObject jsonObject1 = jsonArray.getJSONObject(i);
JSONObject jsonObject2 = jsonObject1.getJSONObject("player");

String summonerName = jsonObject2.getString("summonerName");

if(game_username.equals(summonerName)){
tempParticipantId = i+1;

JSONArray jsonArray1 = jsonObject.getJSONArray("participants");

for(int j=0; j<jsonArray1.length(); j++) {
JSONObject jsonObject3 = jsonArray1.getJSONObject(j);
int tempParticipantId2 = jsonObject3.getInt("participantId");

if(tempParticipantId == tempParticipantId2 ){

int teamId = jsonObject3.getInt("teamId");
spell1Id = jsonObject3.getInt("spell1Id");
spell2Id = jsonObject3.getInt("spell2Id");

for(int k=0; k<jsonArray1.length(); k++){
JSONObject jsonObject4 = jsonArray1.getJSONObject(k);
JSONObject jsonObject5 = jsonObject4.getJSONObject("stats");
int tempId = jsonObject5.getInt("participantId");

if(tempId == tempParticipantId){

permaWin = jsonObject5.getBoolean("win");
intItem0 = jsonObject5.getInt("item0");
intItem1 = jsonObject5.getInt("item1");
intItem2 = jsonObject5.getInt("item2");
intItem3 = jsonObject5.getInt("item3");
intItem4 = jsonObject5.getInt("item4");
intItem5 = jsonObject5.getInt("item5");
intItem6 = jsonObject5.getInt("item6");

int kills = jsonObject5.getInt("kills");
int deaths = jsonObject5.getInt("deaths");
int assists = jsonObject5.getInt("assists");
int totalMinionsKilled = jsonObject5.getInt("totalMinionsKilled");
int goldEarned = jsonObject5.getInt("goldEarned");

readItem();
readSpell();
readSpell2();
readCharacterPhoto(champion);


profileList.add(new Profile(permaSpell1Url,
permaSpell2Url,
permaTimeStamp,
permaWin,
permaItem0Url,
permaItem1Url,
permaItem2Url,
permaItem3Url,
permaItem4Url,
permaItem5Url,
permaItem6Url,
permaChampionPhotoUrl));

}
}
}
}
}
}
} catch (JSONException e) {
e.printStackTrace();
}

profileAdapter = new ProfileAdapter(getContext(), profileList);
recyclerView.setAdapter(profileAdapter);
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.