Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
Research-Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jayakody J.A.D.K.A - IT19114040
Research-Project
Commits
e1ea293e
Commit
e1ea293e
authored
Apr 25, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic Video Upload Code Added
parent
4251af72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
3 deletions
+140
-3
app/src/main/java/com/anuththara18/attentionassessment/alternating/AACompleteScreen.java
...a18/attentionassessment/alternating/AACompleteScreen.java
+47
-0
app/src/main/java/com/anuththara18/attentionassessment/dividedattention/DACompleteScreen.java
...ttentionassessment/dividedattention/DACompleteScreen.java
+44
-0
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
...thara18/attentionassessment/focused/FACompleteScreen.java
+4
-2
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveACompleteScreen.java
...tentionassessment/selective/SelectiveACompleteScreen.java
+2
-1
app/src/main/java/com/anuththara18/attentionassessment/sustained/SA1CompleteScreen.java
...ra18/attentionassessment/sustained/SA1CompleteScreen.java
+43
-0
No files found.
app/src/main/java/com/anuththara18/attentionassessment/alternating/AACompleteScreen.java
View file @
e1ea293e
...
@@ -11,6 +11,7 @@ import android.graphics.Matrix;
...
@@ -11,6 +11,7 @@ import android.graphics.Matrix;
import
android.graphics.Paint
;
import
android.graphics.Paint
;
import
android.graphics.Typeface
;
import
android.graphics.Typeface
;
import
android.graphics.pdf.PdfDocument
;
import
android.graphics.pdf.PdfDocument
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Environment
;
import
android.os.Environment
;
...
@@ -32,6 +33,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
...
@@ -32,6 +33,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.OnSuccessListener
;
import
com.google.android.gms.tasks.Task
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.storage.FirebaseStorage
;
import
com.google.firebase.storage.OnProgressListener
;
import
com.google.firebase.storage.StorageReference
;
import
com.google.firebase.storage.UploadTask
;
import
com.opencsv.CSVWriter
;
import
com.opencsv.CSVWriter
;
import
java.io.File
;
import
java.io.File
;
...
@@ -197,6 +207,8 @@ public class AACompleteScreen extends AppCompatActivity {
...
@@ -197,6 +207,8 @@ public class AACompleteScreen extends AppCompatActivity {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
uploadToFirebase
(
csv
);
/*******************************************************************************************/
/*******************************************************************************************/
// generate our PDF file.
// generate our PDF file.
...
@@ -352,6 +364,41 @@ public class AACompleteScreen extends AppCompatActivity {
...
@@ -352,6 +364,41 @@ public class AACompleteScreen extends AppCompatActivity {
}
}
/**************************************************************************************************/
public
void
uploadToFirebase
(
String
csv
)
{
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
if
(
auth
.
getCurrentUser
()
==
null
)
{
auth
.
signInAnonymously
().
addOnCompleteListener
(
this
,
new
OnCompleteListener
<
AuthResult
>()
{
@Override
public
void
onComplete
(
@NonNull
Task
<
AuthResult
>
task
)
{
Log
.
i
(
"test user"
,
String
.
valueOf
(
task
.
isSuccessful
()));
}
});
}
StorageReference
storageRef
=
FirebaseStorage
.
getInstance
().
getReference
();
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onProgress
(
@NonNull
UploadTask
.
TaskSnapshot
snapshot
)
{
//Toast.makeText(getApplicationContext(), "Upload Filed", Toast.LENGTH_SHORT).show();
}
}).
addOnSuccessListener
(
new
OnSuccessListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onSuccess
(
UploadTask
.
TaskSnapshot
taskSnapshot
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Upload successful"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
}
/**************************************************************************************************/
/**************************************************************************************************/
/**************************************************************************************************/
...
...
app/src/main/java/com/anuththara18/attentionassessment/dividedattention/DACompleteScreen.java
View file @
e1ea293e
...
@@ -36,6 +36,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
...
@@ -36,6 +36,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.OnSuccessListener
;
import
com.google.android.gms.tasks.Task
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.storage.FirebaseStorage
;
import
com.google.firebase.storage.OnProgressListener
;
import
com.google.firebase.storage.StorageReference
;
import
com.google.firebase.storage.UploadTask
;
import
com.opencsv.CSVWriter
;
import
com.opencsv.CSVWriter
;
import
java.io.File
;
import
java.io.File
;
...
@@ -198,6 +207,8 @@ public class DACompleteScreen extends AppCompatActivity {
...
@@ -198,6 +207,8 @@ public class DACompleteScreen extends AppCompatActivity {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
uploadToFirebase
(
csv
);
/*******************************************************************************************/
/*******************************************************************************************/
...
@@ -355,6 +366,39 @@ public class DACompleteScreen extends AppCompatActivity {
...
@@ -355,6 +366,39 @@ public class DACompleteScreen extends AppCompatActivity {
}
}
/**************************************************************************************************/
public
void
uploadToFirebase
(
String
csv
)
{
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
if
(
auth
.
getCurrentUser
()
==
null
)
{
auth
.
signInAnonymously
().
addOnCompleteListener
(
this
,
new
OnCompleteListener
<
AuthResult
>()
{
@Override
public
void
onComplete
(
@NonNull
Task
<
AuthResult
>
task
)
{
Log
.
i
(
"test user"
,
String
.
valueOf
(
task
.
isSuccessful
()));
}
});
}
StorageReference
storageRef
=
FirebaseStorage
.
getInstance
().
getReference
();
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onProgress
(
@NonNull
UploadTask
.
TaskSnapshot
snapshot
)
{
//Toast.makeText(getApplicationContext(), "Upload Filed", Toast.LENGTH_SHORT).show();
}
}).
addOnSuccessListener
(
new
OnSuccessListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onSuccess
(
UploadTask
.
TaskSnapshot
taskSnapshot
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Upload successful"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
}
/**************************************************************************************************/
/**************************************************************************************************/
...
...
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
View file @
e1ea293e
...
@@ -206,6 +206,8 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -206,6 +206,8 @@ public class FACompleteScreen extends AppCompatActivity {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
uploadToFirebase
(
csv
);
/*******************************************************************************************/
/*******************************************************************************************/
...
@@ -345,7 +347,7 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -345,7 +347,7 @@ public class FACompleteScreen extends AppCompatActivity {
}
}
public
void
uploadToFirebase
()
{
public
void
uploadToFirebase
(
String
csv
)
{
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
if
(
auth
.
getCurrentUser
().
getUid
()
==
null
)
{
if
(
auth
.
getCurrentUser
().
getUid
()
==
null
)
{
auth
.
signInAnonymously
();
auth
.
signInAnonymously
();
...
@@ -353,7 +355,7 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -353,7 +355,7 @@ public class FACompleteScreen extends AppCompatActivity {
StorageReference
storageRef
=
FirebaseStorage
.
getInstance
().
getReference
();
StorageReference
storageRef
=
FirebaseStorage
.
getInstance
().
getReference
();
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
Uri
file
=
Uri
.
fromFile
(
new
File
(
this
.
csv
));
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveACompleteScreen.java
View file @
e1ea293e
...
@@ -370,7 +370,8 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
...
@@ -370,7 +370,8 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
"/Game1/"
+
file
.
getLastPathSegment
());
//StorageReference storageReference = storageRef.child(auth.getCurrentUser().getUid() + "/Game1/" + file.getLastPathSegment());
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
@Override
public
void
onProgress
(
@NonNull
UploadTask
.
TaskSnapshot
snapshot
)
{
public
void
onProgress
(
@NonNull
UploadTask
.
TaskSnapshot
snapshot
)
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/sustained/SA1CompleteScreen.java
View file @
e1ea293e
...
@@ -36,6 +36,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
...
@@ -36,6 +36,15 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.gender.GenderActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.home.NavigationDrawerActivity
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.anuththara18.attentionassessment.selective.Selective
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.OnSuccessListener
;
import
com.google.android.gms.tasks.Task
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.storage.FirebaseStorage
;
import
com.google.firebase.storage.OnProgressListener
;
import
com.google.firebase.storage.StorageReference
;
import
com.google.firebase.storage.UploadTask
;
import
com.opencsv.CSVWriter
;
import
com.opencsv.CSVWriter
;
import
java.io.File
;
import
java.io.File
;
...
@@ -197,6 +206,8 @@ public class SA1CompleteScreen extends AppCompatActivity {
...
@@ -197,6 +206,8 @@ public class SA1CompleteScreen extends AppCompatActivity {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
uploadToFirebase
(
csv
);
/*******************************************************************************************/
/*******************************************************************************************/
// generate our PDF file.
// generate our PDF file.
...
@@ -352,6 +363,38 @@ public class SA1CompleteScreen extends AppCompatActivity {
...
@@ -352,6 +363,38 @@ public class SA1CompleteScreen extends AppCompatActivity {
}
}
/**************************************************************************************************/
public
void
uploadToFirebase
(
String
csv
)
{
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
if
(
auth
.
getCurrentUser
()
==
null
)
{
auth
.
signInAnonymously
().
addOnCompleteListener
(
this
,
new
OnCompleteListener
<
AuthResult
>()
{
@Override
public
void
onComplete
(
@NonNull
Task
<
AuthResult
>
task
)
{
Log
.
i
(
"test user"
,
String
.
valueOf
(
task
.
isSuccessful
()));
}
});
}
StorageReference
storageRef
=
FirebaseStorage
.
getInstance
().
getReference
();
Uri
file
=
Uri
.
fromFile
(
new
File
(
csv
));
StorageReference
storageReference
=
storageRef
.
child
(
auth
.
getCurrentUser
().
getUid
()
+
file
.
getLastPathSegment
());
storageReference
.
putFile
(
file
).
addOnProgressListener
(
new
OnProgressListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onProgress
(
@NonNull
UploadTask
.
TaskSnapshot
snapshot
)
{
//Toast.makeText(getApplicationContext(), "Upload Filed", Toast.LENGTH_SHORT).show();
}
}).
addOnSuccessListener
(
new
OnSuccessListener
<
UploadTask
.
TaskSnapshot
>()
{
@Override
public
void
onSuccess
(
UploadTask
.
TaskSnapshot
taskSnapshot
)
{
Toast
.
makeText
(
getApplicationContext
(),
"Upload successful"
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
}
/**************************************************************************************************/
/**************************************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment