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
de7c1b0c
Commit
de7c1b0c
authored
Apr 25, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic Upload of CSV files
parent
96206ad0
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
238 additions
and
90 deletions
+238
-90
app/build.gradle
app/build.gradle
+9
-1
app/google-services.json
app/google-services.json
+39
-0
app/libs/YouTubeAndroidPlayerApi.jar
app/libs/YouTubeAndroidPlayerApi.jar
+0
-0
app/src/main/java/com/anuththara18/attentionassessment/details/ParentDetailsActivity.java
...18/attentionassessment/details/ParentDetailsActivity.java
+1
-1
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
...thara18/attentionassessment/focused/FACompleteScreen.java
+36
-1
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
...18/attentionassessment/focused/FocusedAttentionGame1.java
+87
-87
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveACompleteScreen.java
...tentionassessment/selective/SelectiveACompleteScreen.java
+42
-0
app/src/main/res/layout/activity_introductory_video.xml
app/src/main/res/layout/activity_introductory_video.xml
+22
-0
app/src/main/res/values-si/strings(si).xml
app/src/main/res/values-si/strings(si).xml
+1
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/build.gradle
View file @
de7c1b0c
plugins
{
plugins
{
id
'com.android.application'
id
'com.android.application'
}
}
apply
plugin:
'com.google.gms.google-services'
android
{
android
{
compileSdkVersion
31
compileSdkVersion
31
buildToolsVersion
"30.0.3"
buildToolsVersion
"30.0.3"
...
@@ -33,6 +34,7 @@ dependencies {
...
@@ -33,6 +34,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.4.0'
implementation
'androidx.appcompat:appcompat:1.4.0'
implementation
'com.google.android.material:material:1.4.0'
implementation
'com.google.android.material:material:1.4.0'
implementation
'androidx.constraintlayout:constraintlayout:2.1.2'
implementation
'androidx.constraintlayout:constraintlayout:2.1.2'
implementation
'com.google.firebase:firebase-storage:19.1.1'
testImplementation
'junit:junit:4.+'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.3'
androidTestImplementation
'androidx.test.ext:junit:1.1.3'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.4.0'
...
@@ -44,5 +46,11 @@ dependencies {
...
@@ -44,5 +46,11 @@ dependencies {
implementation
'com.opencsv:opencsv:4.6'
// Here is opencsv library
implementation
'com.opencsv:opencsv:4.6'
// Here is opencsv library
implementation
files
(
'libs\\YouTubeAndroidPlayerApi.jar'
)
implementation
platform
(
'com.google.firebase:firebase-bom:29.3.1'
)
implementation
'com.google.firebase:firebase-auth'
}
}
\ No newline at end of file
app/google-services.json
0 → 100644
View file @
de7c1b0c
{
"project_info"
:
{
"project_number"
:
"642347843728"
,
"project_id"
:
"attention-assessment"
,
"storage_bucket"
:
"attention-assessment.appspot.com"
},
"client"
:
[
{
"client_info"
:
{
"mobilesdk_app_id"
:
"1:642347843728:android:c7e91fc87a80c3a5b61815"
,
"android_client_info"
:
{
"package_name"
:
"com.anuththara18.attentionassessment"
}
},
"oauth_client"
:
[
{
"client_id"
:
"642347843728-u7co8a3vsktblmr57r5r6ees4uof65d4.apps.googleusercontent.com"
,
"client_type"
:
3
}
],
"api_key"
:
[
{
"current_key"
:
"AIzaSyDth7XK-DMLvkNCziMz55eQkSuNCPzWsZk"
}
],
"services"
:
{
"appinvite_service"
:
{
"other_platform_oauth_client"
:
[
{
"client_id"
:
"642347843728-u7co8a3vsktblmr57r5r6ees4uof65d4.apps.googleusercontent.com"
,
"client_type"
:
3
}
]
}
}
}
],
"configuration_version"
:
"1"
}
\ No newline at end of file
app/libs/YouTubeAndroidPlayerApi.jar
0 → 100644
View file @
de7c1b0c
File added
app/src/main/java/com/anuththara18/attentionassessment/details/ParentDetailsActivity.java
View file @
de7c1b0c
...
@@ -105,7 +105,7 @@ public class ParentDetailsActivity extends AppCompatActivity {
...
@@ -105,7 +105,7 @@ public class ParentDetailsActivity extends AppCompatActivity {
}
}
else
{
else
{
diagnosis
=
(
String
)
genderradioButton
.
getText
();
diagnosis
=
(
String
)
genderradioButton
.
getText
();
Toast
.
makeText
(
ParentDetailsActivity
.
this
,
genderradioButton
.
getText
(),
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(ParentDetailsActivity.this,genderradioButton.getText(), Toast.LENGTH_SHORT).show();
nav
=
1
;
nav
=
1
;
if
(
LanguageActivity
.
text
.
equals
(
"English"
))
{
if
(
LanguageActivity
.
text
.
equals
(
"English"
))
{
startActivity
(
new
Intent
(
ParentDetailsActivity
.
this
,
ConsentFormActivity
.
class
));
startActivity
(
new
Intent
(
ParentDetailsActivity
.
this
,
ConsentFormActivity
.
class
));
...
...
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
View file @
de7c1b0c
...
@@ -36,6 +36,12 @@ import com.anuththara18.attentionassessment.details.ParentDetailsActivity;
...
@@ -36,6 +36,12 @@ 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.OnSuccessListener
;
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
;
...
@@ -56,6 +62,8 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -56,6 +62,8 @@ public class FACompleteScreen extends AppCompatActivity {
List
<
Focused
>
dataList
;
List
<
Focused
>
dataList
;
SQLiteDatabase
mDatabase
;
SQLiteDatabase
mDatabase
;
String
csv
;
// declaring width and height
// declaring width and height
// for our PDF file.
// for our PDF file.
int
pageHeight
=
1520
;
int
pageHeight
=
1520
;
...
@@ -161,7 +169,7 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -161,7 +169,7 @@ public class FACompleteScreen extends AppCompatActivity {
/*******************************************************************************************/
/*******************************************************************************************/
String
csv
=
(
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/FocusedAttention.csv"
);
// Here csv file name is MyCsvFile.csv
csv
=
(
Environment
.
getExternalStorageDirectory
().
getAbsolutePath
()
+
"/FocusedAttention.csv"
);
// Here csv file name is MyCsvFile.csv
// csv will create inside phone storage.
// csv will create inside phone storage.
CSVWriter
writer
=
null
;
CSVWriter
writer
=
null
;
...
@@ -337,6 +345,33 @@ public class FACompleteScreen extends AppCompatActivity {
...
@@ -337,6 +345,33 @@ public class FACompleteScreen extends AppCompatActivity {
}
}
public
void
uploadToFirebase
()
{
FirebaseAuth
auth
=
FirebaseAuth
.
getInstance
();
if
(
auth
.
getCurrentUser
().
getUid
()
==
null
)
{
auth
.
signInAnonymously
();
}
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/FocusedAttentionGame1.java
View file @
de7c1b0c
This diff is collapsed.
Click to expand it.
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveACompleteScreen.java
View file @
de7c1b0c
...
@@ -35,6 +35,15 @@ import com.anuththara18.attentionassessment.consentform.ParentsConsentDatabaseHe
...
@@ -35,6 +35,15 @@ import com.anuththara18.attentionassessment.consentform.ParentsConsentDatabaseHe
import
com.anuththara18.attentionassessment.details.ParentDetailsActivity
;
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.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
;
...
@@ -196,6 +205,8 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
...
@@ -196,6 +205,8 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
uploadToFirebase
(
csv
);
/*******************************************************************************************/
/*******************************************************************************************/
PdfDocument
pdfDocument
=
new
PdfDocument
();
PdfDocument
pdfDocument
=
new
PdfDocument
();
...
@@ -343,4 +354,35 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
...
@@ -343,4 +354,35 @@ public class SelectiveACompleteScreen extends AppCompatActivity {
return
scaledBitmap
;
return
scaledBitmap
;
}
}
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
()
+
"/Game1/"
+
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/res/layout/activity_introductory_video.xml
View file @
de7c1b0c
...
@@ -5,8 +5,22 @@
...
@@ -5,8 +5,22 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:background=
"@color/white"
tools:context=
".videos.IntroductoryVideoPortraitActivity"
>
tools:context=
".videos.IntroductoryVideoPortraitActivity"
>
<TextView
android:id=
"@+id/skip"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:fontFamily=
"@font/poppins_medium"
android:gravity=
"center"
android:text=
"@string/skip"
android:textColor=
"@color/black"
android:textSize=
"16sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<WebView
android:id=
"@+id/videoView"
<WebView
android:id=
"@+id/videoView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
@@ -14,4 +28,12 @@
...
@@ -14,4 +28,12 @@
android:layout_centerHorizontal=
"true"
>
android:layout_centerHorizontal=
"true"
>
</WebView>
</WebView>
<!--
<com.google.android.youtube.player.YouTubePlayerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/ytPlayer"
app:layout_constraintTop_toTopOf="parent"/>
-->
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values-si/strings(si).xml
View file @
de7c1b0c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<string
name=
"girl"
>
ගැහැණු
</string>
<string
name=
"girl"
>
ගැහැණු
</string>
<string
name=
"boy"
>
පිරිමි
</string>
<string
name=
"boy"
>
පිරිමි
</string>
<string
name=
"next"
>
ඊළඟ
</string>
<string
name=
"next"
>
ඊළඟ
</string>
<string
name=
"skip"
>
මඟ හැර යන්න...
</string>
<string
name=
"previous"
>
පෙර
</string>
<string
name=
"previous"
>
පෙර
</string>
<string
name=
"age"
>
ඔබේ දරුවාගේ වයස තෝරන්න:
</string>
<string
name=
"age"
>
ඔබේ දරුවාගේ වයස තෝරන්න:
</string>
<string
name=
"language"
>
භාෂාව තෝරන්න:
</string>
<string
name=
"language"
>
භාෂාව තෝරන්න:
</string>
...
...
app/src/main/res/values/strings.xml
View file @
de7c1b0c
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<string
name=
"girl"
>
Girl
</string>
<string
name=
"girl"
>
Girl
</string>
<string
name=
"boy"
>
Boy
</string>
<string
name=
"boy"
>
Boy
</string>
<string
name=
"next"
>
Next
</string>
<string
name=
"next"
>
Next
</string>
<string
name=
"skip"
>
Skip...
</string>
<string
name=
"previous"
>
Previous
</string>
<string
name=
"previous"
>
Previous
</string>
<string
name=
"age"
>
Select your child\'s age:
</string>
<string
name=
"age"
>
Select your child\'s age:
</string>
<string
name=
"language"
>
Select language:
</string>
<string
name=
"language"
>
Select language:
</string>
...
...
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