Fixede EndActivity.java

This commit is contained in:
wildercayden 2025-01-23 14:11:18 -05:00 committed by GitHub
parent 804d577d72
commit f545996945
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,6 @@
package com.example.scoutingapp; package com.example.scoutingapp;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
@ -42,16 +43,12 @@ public class EndActivity extends AppCompatActivity {
public void onClick(View view) { public void onClick(View view) {
Submit submit = new Submit(); Submit submit = new Submit();
//Writes test Data to the String getTeamNumber
//submit.getTeamNumberTest();
//Makes the CSV file
//submit.CSVmake(EndActivity.this);
//Writes data to file to make google sheet read it as a list //Writes data to file to make google sheet read it as a list
File csvFile = new File(getExternalFilesDir(null), "match_data.csv"); File csvFile = new File(getFilesDir(), "match_data.csv");
List<List<Object>> data = submit.parseCSVToList(csvFile); List<List<Object>> data = submit.parseCSVToList(csvFile);
submit.parseCSVToList(csvFile); submit.parseCSVToList(csvFile);
//Uploads the Data to the Google sheet //Uploads the Data to the Google sheet
//submit.uploadCSV(EndActivity.this); submit.uploadSheets(EndActivity.this);
} }
}); });
@ -68,4 +65,7 @@ public class EndActivity extends AppCompatActivity {
} }
} }

View File

@ -29,7 +29,7 @@ public class Submit {
//adds account info //adds account info
InputStream serviceAccountStream = context.getResources().openRawResource(R.raw.info); InputStream serviceAccountStream = context.getResources().openRawResource(R.raw.info);
ServiceAccountCredentials credentials = ServiceAccountCredentials.fromStream(serviceAccountStream); ServiceAccountCredentials credentials = ServiceAccountCredentials.fromStream(serviceAccountStream);
//Srts up the google sheet API and json factury for use later //Sets up the google sheet API and json factory for use later
Sheets sheetsService = new Sheets.Builder( Sheets sheetsService = new Sheets.Builder(
GoogleNetHttpTransport.newTrustedTransport(), GoogleNetHttpTransport.newTrustedTransport(),
GsonFactory.getDefaultInstance(), GsonFactory.getDefaultInstance(),