Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4d44880
first ommit
Kevvie-bennettine Nov 29, 2017
28a09fb
create buttons and remove title bar
Kevvie-bennettine Nov 29, 2017
ec74400
setup part of title screen, changed api level to 23
Kevvie-bennettine Dec 21, 2017
01d1684
added title background
Kevvie-bennettine Dec 21, 2017
97465b5
Add QuestionActivity and ContinueQuest pop-up
Vallyath Dec 22, 2017
88fbc0f
Resolve merge conflict
Vallyath Dec 22, 2017
384daca
Implement view method, and update onClick
Vallyath Dec 22, 2017
c97e0d5
Fix play button
Vallyath Dec 22, 2017
d3ae3ef
fix button alignment on question xml file
Vallyath Dec 22, 2017
14ec153
popup window in progress
Kevvie-bennettine Dec 22, 2017
761368a
popup window in progress(2)
Kevvie-bennettine Dec 22, 2017
2155901
Fix merge conflict
Vallyath Dec 22, 2017
d92deb3
added choose character dialog as it's own DialogFragment
Kevvie-bennettine Dec 22, 2017
6421da7
added styles, ChooseCharacter works but needs a background and contro…
Kevvie-bennettine Dec 24, 2017
b8f395d
Change continueQ tag
Vallyath Dec 27, 2017
a4479b2
Resolve merge conflict
Vallyath Dec 27, 2017
4975af9
changed which button calls which popup
Kevvie-bennettine Jan 5, 2018
e51b33a
added question fetching functionallity, and set bg image
Kevvie-bennettine Jan 9, 2018
2463265
Add progress bar, button shuffle base code, and placeholder Textviews.
Vallyath Jan 22, 2018
41ea8fb
updated..?
Kevvie-bennettine Jan 22, 2018
7418d81
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 22, 2018
0bc8e54
fixed question randomizer
Kevvie-bennettine Jan 22, 2018
163049c
Add base progress bar functionality
Vallyath Jan 26, 2018
a38e86b
built part of networking code
Kevvie-bennettine Jan 26, 2018
d8da356
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 26, 2018
5ca090a
Updated global attributes, and previous commit has layout changes
Vallyath Jan 26, 2018
98d4f7f
test commit to resolve merge conflict
Vallyath Jan 26, 2018
20f862a
finished building basic server
Kevvie-bennettine Jan 26, 2018
9b74089
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 26, 2018
f1fc6e4
Room functionality in place, trying to tie to SQL
Vallyath Jan 27, 2018
21a9a1d
updated GUI, button texture and background pic
Kevvie-bennettine Jan 27, 2018
14f19c5
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 27, 2018
a01b3a2
Revert "updated GUI, button texture and background pic"
Kevvie-bennettine Jan 27, 2018
76f7ef8
commit after revert
Kevvie-bennettine Jan 27, 2018
3a7d7bf
Added Room database class
Vallyath Jan 27, 2018
e3af1a1
added button texture and question background
Kevvie-bennettine Jan 27, 2018
25d888c
resloved conflict
Kevvie-bennettine Jan 27, 2018
56d5f54
added gambler sprite
Kevvie-bennettine Jan 27, 2018
917505b
Added stats pop up and changed corrAns to correct type
Vallyath Jan 27, 2018
80f681d
test commit to resolve merge conflict
Vallyath Jan 27, 2018
7eab925
Resolved merge conflict
Vallyath Jan 27, 2018
4581e06
Working on stats pop up, added graphs and image
Vallyath Jan 27, 2018
dbe245c
Waiting on global attributes, stats pop up mostly complete
Vallyath Jan 27, 2018
d67a23a
added dexter, better organized JSON section
Kevvie-bennettine Jan 27, 2018
c6c0e54
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 27, 2018
7e7fb5d
Added Calendar class and updated android manifest
Vallyath Jan 27, 2018
1c1e55d
Fixed button call
Vallyath Jan 27, 2018
8de95c3
networking testing success, room code commented for testing
Kevvie-bennettine Jan 28, 2018
fb7a577
Deprecated Calendar class, updated manifest
Vallyath Jan 28, 2018
51da5ad
Resolve merge conflict
Vallyath Jan 28, 2018
3b63d43
added background
Kevvie-bennettine Jan 28, 2018
ff2ab41
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 28, 2018
9ecdb3b
Set up Google Calendar Quickstart
Vallyath Jan 28, 2018
5375bf4
Resolve merge conflicts
Vallyath Jan 28, 2018
b9c27cf
added calendar button
Kevvie-bennettine Jan 28, 2018
cc09d90
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 28, 2018
6165ce1
Implemented Calendar Quickstart code, need to add Event adding
Vallyath Jan 28, 2018
6b0e1b2
Include new Calendar layout
Vallyath Jan 28, 2018
9eda95c
Resolve merge conflict
Vallyath Jan 28, 2018
ebde268
added new button images, attribute test success
Kevvie-bennettine Jan 28, 2018
023d697
Merge branch 'master' of https://github.com/Vallyath/ICS4U1a201718_Fi…
Kevvie-bennettine Jan 28, 2018
b58f25a
Deprecated Calendar, finished graphs
Vallyath Jan 28, 2018
add7f19
final touches
Kevvie-bennettine Jan 28, 2018
e8657e9
Solve merge conflict
Vallyath Jan 28, 2018
51d8947
Resolve merge conflict again
Vallyath Jan 28, 2018
ab3d0fd
changed a bit
Kevvie-bennettine Jan 28, 2018
4673c4c
resolved conflict
Kevvie-bennettine Jan 28, 2018
ea7db86
Updated bar graph in statspopup
Vallyath Jan 28, 2018
38fa928
final product
Kevvie-bennettine Jan 28, 2018
1b0a44b
final product commit
Kevvie-bennettine Jan 28, 2018
2d4baec
Added comments
Vallyath Jan 28, 2018
309608e
Resolved merge conflict
Vallyath Jan 28, 2018
787414f
Added tutorial slides, added title
Vallyath Jan 28, 2018
808c5d2
re-organized choose activity
Kevvie-bennettine Jan 28, 2018
2deb6ae
resloved conflict
Kevvie-bennettine Jan 28, 2018
dfafec0
final commit
Kevvie-bennettine Jan 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
47 changes: 47 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
defaultConfig {
applicationId "team_infinity.boundless_manifest"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.github.paolorotolo:appintro:4.0.0' //implements tutorial
compile 'com.jjoe64:graphview:4.2.1' //implements graphview
compile 'android.arch.persistence.room:runtime:1.0.0'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'pub.devrel:easypermissions:0.3.0'
compile('com.google.api-client:google-api-client-android:1.23.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-calendar:v3-rev287-1.23.0') {
exclude group: 'org.apache.httpcomponents'
}

}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package team_infinity.boundless_manifest;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("team_infinity.boundless_manifest", appContext.getPackageName());
}
}
33 changes: 33 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="team_infinity.boundless_manifest">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:screenOrientation="portrait">
<activity android:name=".MainMenuActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".TutorialSlides"/>
<activity android:name=".QuestionActivity"></activity>
<activity android:name=".FinishActivity"/>
</application>
<uses-sdk android:minSdkVersion="27" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />

<!-- request premission from user to access internet -->
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
package team_infinity.boundless_manifest;

import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.URL;

/**
* Created by Acer on 2018-01-24.
*/

public class AjaxQuestionGetter implements QuestionGetterBase
{
/**
* getting a question by sending a JSON Ajax request
* @return a question
*/
@Override
public Question getQuestion(long id)
{
Log.d("qst", "AjaxQuestionGetter.getQuestion(): called, id: " + id);
String request = this.createJsonObjectToString(id);

//create an AsyncTask and execute it
JSONAsyncTask jsonAsyncTask = new JSONAsyncTask();
jsonAsyncTask.execute(request, "qestn");

//infinite loop to check if progress done
while(true)
{
/*
note:
this is definitly not de right waey to use AsyncTask
but since AsyncTask.onPostExecute() is sent to and called
directly in the GUI dispatcher thread,
and I want to do something else with the result,
so I do it the very stupid way
(could have used a Thread Runnable lol)
-Kevin
*/
String prog = jsonAsyncTask.getProgress();
if(prog == "done")
{
break;
}
else if (prog == "error")
{
Log.e("json", "AjaxQuestionGetter.getQuestion(): error occured");
return null;
}

try
{
Thread.sleep(10);
}
catch (InterruptedException ie)
{
Log.d("json", "AjaxQuestionGetter.getQuestion(): thread sleep interrupted");
}
}

//get the string and print to debug log
String res = jsonAsyncTask.getResulte();
Log.d("json", "AjaxQuestionGetter.getQuestion(): result string: " + res);

Question result = this.convert(res);

return result;
}

/**
* method for creating a JSONObject object
* @param id the id of the session
* @return the json object
*/
public String createJsonObjectToString(long id)
{
JSONObject requestBody = new JSONObject();

try
{
//only id matters
requestBody.accumulate("subject", "");
requestBody.accumulate("level", 0);
requestBody.accumulate("sessionId", id);
}
catch(org.json.JSONException e)//handle exception
{
Log.e("json", "AjaxQuestionGetter.createJsonObjectToString(): exception: " + e.getMessage());
}

return requestBody.toString();
}

/**
* convert the output to Question object
* @param s the String returned from request
* @return the Question object
*/
public Question convert(String s)
{
Log.d("json", "AjaxQuestionGetter.convert(): called, string: " + s);
Question result = null;

try
{
JSONObject resul = new JSONObject(s);
JSONObject qstn = resul.getJSONObject("question");

//get the content of the question from JSON
String questionTitle = qstn.getString("question");

//get the answers from answers array
JSONArray answersJson = qstn.getJSONArray("answers");
String[] answers = new String[4];
for(int ct=0; ct<4; ct++)
{
answers[ct] = answersJson.getString(ct);
}
//id and correct answer
int correctAnswer = qstn.getInt("correctAnswer");
long id = qstn.getLong("id");
String attribute = qstn.getString("attribute");

//put them all together into one object
result = new Question(questionTitle, answers, id, correctAnswer, attribute);
}
catch(JSONException jsone)
{
Log.e("json", "AjaxQuestionGetter.convert() JSONException: " + jsone.getLocalizedMessage());
}

return result;
}
}
Loading