From 2a6923fe4dd299021114a4434c2b30d11d818ab1 Mon Sep 17 00:00:00 2001
From: ect1u17 <ect1u17@soton.ac.uk>
Date: Tue, 18 Feb 2020 17:49:41 +0000
Subject: [PATCH] Changes since last commit: - Made small changes to code to
 suppress typos or errors or warnings

---
 .idea/dictionaries/Eamonn.xml                 |  24 +
 LICENSE                                       |   2 +-
 app/build.gradle                              |   4 +-
 app/src/main/AndroidManifest.xml              |   2 +-
 .../xbframework/AboutActivity.java            |  14 +-
 .../xbframework/BoxesActivity.java            |  34 +-
 .../xbframework/ExperimentActivity.java       |  34 +-
 .../ExperimentSurveyCreatorActivity.java      | 489 +++++++++++++-----
 .../xbframework/FileStoreReader.java          |  17 +-
 .../xbframework/LoginActivity.java            |  16 +-
 .../xbframework/MainActivity.java             |  71 +--
 .../xbframework/MyNotificationPublisher.java  |   5 +-
 .../yearthreeproject/xbframework/NewBox.java  | 331 ++++++------
 .../xbframework/ProgressActivity.java         |  14 +-
 .../xbframework/ProjectMacros.java            |  16 +
 .../xbframework/ShopActivity.java             |  35 +-
 .../xbframework/TestingActivity.java          |  18 +-
 .../main/res/drawable/notification_icon.xml   |   4 -
 app/src/main/res/layout/content_about.xml     |   4 -
 app/src/main/res/layout/content_boxes.xml     |   2 -
 .../main/res/layout/content_experiment.xml    |  12 +-
 .../content_experiment_survey_creator.xml     |  10 +-
 app/src/main/res/layout/content_login.xml     |  14 +-
 app/src/main/res/layout/content_main.xml      |   2 +-
 app/src/main/res/layout/content_new_box.xml   | 153 ++----
 app/src/main/res/layout/content_progress.xml  |   6 +-
 app/src/main/res/layout/content_shop.xml      |   3 -
 app/src/main/res/layout/content_testing.xml   |   6 +-
 app/src/main/res/menu/menu_main.xml           |  10 -
 app/src/main/res/values/arrays.xml            |   2 +-
 app/src/main/res/values/colors.xml            |   1 -
 app/src/main/res/values/idValues.xml          |   1 -
 app/src/main/res/values/strings.xml           |  28 +-
 app/src/main/res/values/styles.xml            |   2 -
 34 files changed, 773 insertions(+), 613 deletions(-)
 create mode 100644 .idea/dictionaries/Eamonn.xml
 create mode 100644 app/src/main/java/com/yearthreeproject/xbframework/ProjectMacros.java
 delete mode 100644 app/src/main/res/drawable/notification_icon.xml
 delete mode 100644 app/src/main/res/menu/menu_main.xml

diff --git a/.idea/dictionaries/Eamonn.xml b/.idea/dictionaries/Eamonn.xml
new file mode 100644
index 0000000..128992e
--- /dev/null
+++ b/.idea/dictionaries/Eamonn.xml
@@ -0,0 +1,24 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="Eamonn">
+    <words>
+      <w>affero</w>
+      <w>artefact</w>
+      <w>artefacts</w>
+      <w>autofill</w>
+      <w>eamonn</w>
+      <w>edmodo</w>
+      <w>exper</w>
+      <w>fanta</w>
+      <w>licensor</w>
+      <w>licensors</w>
+      <w>meecs</w>
+      <w>relicensing</w>
+      <w>sublicenses</w>
+      <w>sublicensing</w>
+      <w>theartofdev</w>
+      <w>wipo</w>
+      <w>xbframework</w>
+      <w>yearthreeproject</w>
+    </words>
+  </dictionary>
+</component>
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index e72bfdd..6ae09eb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -268,7 +268,7 @@ in one of these ways:
 
     c) Convey individual copies of the object code with a copy of the
     written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
+    alternative is allowed only occasionally and non-commercially, and
     only if you received the object code with such an offer, in accord
     with subsection 6b.
 
diff --git a/app/build.gradle b/app/build.gradle
index 528d298..d4b73f1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -29,6 +29,6 @@ dependencies {
     testImplementation 'junit:junit:4.12'
     androidTestImplementation 'androidx.test.ext:junit:1.1.1'
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
-    implementation 'com.google.android.material:material:1.0.0'
-    api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
+    implementation 'com.google.android.material:material:1.1.0'
+    api 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
 }
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9d6679e..c2d5c50 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
     <application
-        android:allowBackup="true"
+        android:allowBackup="false"
         android:icon="@raw/logo"
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher_round"
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/AboutActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/AboutActivity.java
index 74eae45..046055e 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/AboutActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/AboutActivity.java
@@ -1,30 +1,32 @@
 package com.yearthreeproject.xbframework;
 
+import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.Button;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 
-public class AboutActivity extends AppCompatActivity {
+import java.util.Objects;
 
-    private Button backHomeButton;
-    private Toolbar toolbar;
+public class AboutActivity extends AppCompatActivity {
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_about);
 
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
-        backHomeButton = (Button) findViewById(R.id.AboutBackHomeButton);
+        Button backHomeButton = findViewById(R.id.AboutBackHomeButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/BoxesActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/BoxesActivity.java
index 58db681..67359a9 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/BoxesActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/BoxesActivity.java
@@ -25,14 +25,12 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.Calendar;
+import java.util.Objects;
 
 import static android.util.Log.d;
 
 public class BoxesActivity extends AppCompatActivity {
 
-    private Toolbar toolbar;
-    private Button backHomeButton;
-
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuItem createBox = menu.add("Create New Box!");
@@ -46,21 +44,22 @@ public class BoxesActivity extends AppCompatActivity {
         return true;
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         // Ordinary setup of UI for general app purposes
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_boxes);
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
         // JSON loading from local directory, could be implemented to stream from online
         loadAndDisplayJSON();
 
-        backHomeButton = findViewById(R.id.BoxesBackHomeButton);
+        Button backHomeButton = findViewById(R.id.BoxesBackHomeButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
@@ -68,7 +67,8 @@ public class BoxesActivity extends AppCompatActivity {
         });
     }
 
-    protected void loadAndDisplayJSON(){
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+    private void loadAndDisplayJSON(){
         LinearLayout inFiveLayout = findViewById(R.id.BoxesInFiveLayout);
         JSONArray boxes;
         final String[] inFive = {"Move", "Eat", "Engage", "Cogitate", "Sleep"};
@@ -76,7 +76,7 @@ public class BoxesActivity extends AppCompatActivity {
         // Try, in order to avoid errors in compilation and catastrophic errors
         try {
 
-            d("boxesParse", FileStoreReader.readFile(this, "boxData.json"));
+            d("dbg_boxesParse", FileStoreReader.readFile(this, "boxData.json"));
 
             boxes = new JSONArray(FileStoreReader.readFile(this, "boxData.json"));
 
@@ -172,50 +172,50 @@ public class BoxesActivity extends AppCompatActivity {
         Calendar calendar = Calendar.getInstance();
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
         String dateToday = simpleDateFormat.format(calendar.getTime());
-        d("dateTodayYear", dateToday);
+        d("dbg_dateTodayYear", dateToday);
 
         Integer dateTodayYear = 1000*Character.getNumericValue(dateToday.codePointAt(0))+100*Character.getNumericValue(dateToday.codePointAt(1))+10*Character.getNumericValue(dateToday.codePointAt(2))+Character.getNumericValue(dateToday.codePointAt(3));
 
         String dateLimitFormatted = dateLimit.substring(dateLimit.length()-4);
-        d("dateDeadlineYear", dateLimitFormatted);
+        d("dbg_dateDeadlineYear", dateLimitFormatted);
 
         Integer dateLimitYear = 1000*Character.getNumericValue(dateLimitFormatted.codePointAt(0))+100*Character.getNumericValue(dateLimitFormatted.codePointAt(1))+10*Character.getNumericValue(dateLimitFormatted.codePointAt(2))+Character.getNumericValue(dateLimitFormatted.codePointAt(3));
 
 
         if(dateTodayYear > dateLimitYear){
-            d("dateTest", "Release from lock");
+            d("dbg_dateTest", "Release from lock");
             return true;
         }else if(dateTodayYear >= dateLimitYear){
             simpleDateFormat = new SimpleDateFormat("MM");
             dateToday = simpleDateFormat.format(calendar.getTime());
 
-            d("dateTodayMonth", dateToday);
+            d("dbg_dateTodayMonth", dateToday);
 
             Integer dateTodayMonth = 10*Character.getNumericValue(dateToday.codePointAt(0))+Character.getNumericValue(dateToday.codePointAt(1));
 
             dateLimitFormatted = dateLimit.substring(dateLimit.length()-7, dateLimit.length()-5);
-            d("dateDeadlineMonth", dateLimitFormatted);
+            d("dbg_dateDeadlineMonth", dateLimitFormatted);
 
             Integer dateLimitMonth = 10*Character.getNumericValue(dateLimitFormatted.codePointAt(0))+Character.getNumericValue(dateLimitFormatted.codePointAt(1));
 
             if(dateTodayMonth > dateLimitMonth){
-                d("dateTest", "Release from lock");
+                d("dbg_dateTest", "Release from lock");
                 return true;
             }else if(dateTodayMonth >= dateLimitMonth){
                 simpleDateFormat = new SimpleDateFormat("dd");
                 dateToday = simpleDateFormat.format(calendar.getTime());
 
-                d("dateTodayDay", dateToday);
+                d("dbg_dateTodayDay", dateToday);
 
                 Integer dateTodayDay = 10*Character.getNumericValue(dateToday.codePointAt(0))+Character.getNumericValue(dateToday.codePointAt(1));
 
                 dateLimitFormatted = dateLimit.substring(dateLimit.length()-10, dateLimit.length()-8);
-                d("dateDeadlineDay", dateLimitFormatted);
+                d("dbg_dateDeadlineDay", dateLimitFormatted);
 
                 Integer dateLimitDay = 10*Character.getNumericValue(dateLimitFormatted.codePointAt(0))+Character.getNumericValue(dateLimitFormatted.codePointAt(1));
 
                 if(dateTodayDay >= dateLimitDay){
-                    d("dateTest", "Date today is later than locked date!");
+                    d("dbg_dateTest", "Date today is later than locked date!");
                     return true;
                 }
 
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/ExperimentActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/ExperimentActivity.java
index bbcbb05..4932562 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/ExperimentActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/ExperimentActivity.java
@@ -22,30 +22,30 @@ import org.json.JSONObject;
 
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Objects;
 
 import static android.util.Log.d;
+import static java.util.Objects.requireNonNull;
 
 public class ExperimentActivity extends AppCompatActivity {
 
-    private Toolbar toolbar;
-    private Button backHomeButton;
-    private Button submitButton;
     private ArrayList<RadioButton> experimentsRadioButtonArray;
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_experiment);
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
         LinearLayout experimentInfoLayout = findViewById(R.id.ExperimentInfoLayout);
 
         try {
-            JSONObject boxJSON = new JSONObject(getIntent().getStringExtra("JSON"));
+            JSONObject boxJSON = new JSONObject(requireNonNull(getIntent().getStringExtra("JSON")));
             setTitle(boxJSON.getString("Name")); // Sets the title of the page (in the toolbar)
 
             /* Description | TextView
@@ -69,7 +69,7 @@ public class ExperimentActivity extends AppCompatActivity {
 
             JSONArray experimentsJSONArray = boxJSON.getJSONArray("Experiments");
 
-            experimentsRadioButtonArray = new ArrayList<RadioButton>();
+            experimentsRadioButtonArray = new ArrayList<>();
 
             int radioButtonUniqueId = 0;
 
@@ -117,24 +117,24 @@ public class ExperimentActivity extends AppCompatActivity {
             e.printStackTrace();
         }
 
-        submitButton = findViewById(R.id.ExperimentSubmitButton);
+        Button submitButton = findViewById(R.id.ExperimentSubmitButton);
         submitButton.setOnClickListener(new View.OnClickListener() {
             @RequiresApi(api = Build.VERSION_CODES.N)
             public void onClick(View v) {
                 for(int x = 0; x < experimentsRadioButtonArray.size(); x++)
                     if(experimentsRadioButtonArray.get(x).isChecked()){
-                        Integer psudoCount = 0;
-                        Integer experimentGroup = 0;
-                        d("submit", experimentsRadioButtonArray.get(x).getText().toString());
+                        int pseudoCount = 0;
+                        int experimentGroup = 0;
+                        d("dbg_submit", experimentsRadioButtonArray.get(x).getText().toString());
                         try {
-                            JSONObject boxJSON = new JSONObject(getIntent().getStringExtra("JSON"));
+                            JSONObject boxJSON = new JSONObject(requireNonNull(getIntent().getStringExtra("JSON")));
                             for(int i = 0; i < boxJSON.getJSONArray("Experiments").length(); i++){
-                                if(boxJSON.getJSONArray("Experiments").getJSONObject(i).getJSONArray("Options").length()+psudoCount <= x){
-                                    psudoCount += boxJSON.getJSONArray("Experiments").getJSONObject(i).getJSONArray("Options").length();
+                                if(boxJSON.getJSONArray("Experiments").getJSONObject(i).getJSONArray("Options").length()+pseudoCount <= x){
+                                    pseudoCount += boxJSON.getJSONArray("Experiments").getJSONObject(i).getJSONArray("Options").length();
                                     experimentGroup++;
                                 } else {
                                     JSONObject editJSON = new JSONObject(FileStoreReader.readFile(ExperimentActivity.this, "localUserData.json"));
-                                    editJSON.put("lockedExperiment", boxJSON.getJSONArray("Experiments").getJSONObject(experimentGroup).getJSONArray("Options").getJSONObject(x-psudoCount));
+                                    editJSON.put("lockedExperiment", boxJSON.getJSONArray("Experiments").getJSONObject(experimentGroup).getJSONArray("Options").getJSONObject(x-pseudoCount));
 
                                     Calendar calendar = Calendar.getInstance();
                                     SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
@@ -146,7 +146,7 @@ public class ExperimentActivity extends AppCompatActivity {
 
                                     FileStoreReader.saveFile(ExperimentActivity.this, "localUserData.json", editJSON.toString());
 
-                                    d("storedJSON", editJSON.toString());
+                                    d("dbg_storedJSON", editJSON.toString());
                                     finish();
                                 }
                             }
@@ -158,7 +158,7 @@ public class ExperimentActivity extends AppCompatActivity {
             }
         });
 
-        backHomeButton = findViewById(R.id.ExperimentBackHomeButton);
+        Button backHomeButton = findViewById(R.id.ExperimentBackHomeButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/ExperimentSurveyCreatorActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/ExperimentSurveyCreatorActivity.java
index 61cb15d..9f6f0bc 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/ExperimentSurveyCreatorActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/ExperimentSurveyCreatorActivity.java
@@ -1,11 +1,13 @@
 package com.yearthreeproject.xbframework;
 
+import android.app.TimePickerDialog;
 import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
+import android.util.DisplayMetrics;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
@@ -16,6 +18,8 @@ import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.Switch;
 import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
 
 import androidx.annotation.Nullable;
 import androidx.annotation.RequiresApi;
@@ -28,6 +32,7 @@ import org.json.JSONObject;
 
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.List;
 import java.util.Objects;
 
@@ -36,10 +41,25 @@ import static android.util.Log.d;
 public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
 
     private int uniqueID = 1;
-    private List<EditText> experimentQuestions = new ArrayList<>();
-    private List<TextView> experimentQuestionLabels = new ArrayList<>();
-    private List<Button> deleteQuestionButtons = new ArrayList<>();
-    private List<TextView> notificationLabels = new ArrayList<>();
+
+    final private List<TextView> questionLabels = new ArrayList<>();
+    final private List<EditText> questionEditTexts = new ArrayList<>();
+
+    final private List<TextView> notificationLabels = new ArrayList<>();
+    final private List<EditText> notificationMessageEditTexts = new ArrayList<>();
+    final private List<EditText> notificationTimeEditTexts = new ArrayList<>();
+    final private List<EditText> notificationRepeatEditTexts = new ArrayList<>();
+
+    private boolean videoProcessing = false;
+    private boolean audioProcessing = false;
+    private boolean imageProcessing = false;
+    private boolean surveyQuestions = true;
+    private boolean customNotifications = false;
+    private boolean artefactImplementation = false;
+
+    private Toast submitToast;
+
+    // TODO: Basic functionality of submission is competed, the next step here would be to give some hints as to what each section did and what is advised to go there (for a later date)
 
     @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
@@ -82,33 +102,36 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
 
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     private void initialGUILoad(JSONObject boxInfo) {
         titleBarInit(boxInfo);
         LinearLayout scrollLayout = findViewById(R.id.SurveyCreationLayout);
         scrollLayout.addView(staticMetaDataLayout(boxInfo));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
         scrollLayout.addView(surveyDataLayout());
-        scrollLayout.addView(newHR(4));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
         scrollLayout.addView(notificationLayout());
-        scrollLayout.addView(newHR(4));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
         scrollLayout.addView(imageProcessingLayout());
-        scrollLayout.addView(newHR(4));
-        scrollLayout.addView(artefactImplementationLayout());
-        scrollLayout.addView(newHR(4));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
+        scrollLayout.addView(artifactImplementationLayout());
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
         scrollLayout.addView(audioProcessingLayout());
-        scrollLayout.addView(newHR(4));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
         scrollLayout.addView(videoProcessingLayout());
-        scrollLayout.addView(newHR(4));
+        scrollLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
     }
 
-    private View artefactImplementationLayout() {
+    private View artifactImplementationLayout() {
         final RelativeLayout artefactLayout = new RelativeLayout(this);
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Artefacts");
+        String artefactsString = "Artefacts";
+        surveyTitle.setText(artefactsString);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(false);
+        surveyToggleSlider.setChecked(artefactImplementation);
 
         RelativeLayout.LayoutParams sliderAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         sliderAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@@ -124,11 +147,7 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         surveyToggleSlider.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    // Set global variables
-                } else {
-
-                }
+                artefactImplementation = isChecked;
             }
         });
 
@@ -139,11 +158,12 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         final RelativeLayout videoLayout = new RelativeLayout(this);
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Video Upload");
+        String textViewTempText = "Video Upload";
+        surveyTitle.setText(textViewTempText);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(false);
+        surveyToggleSlider.setChecked(videoProcessing);
 
         RelativeLayout.LayoutParams sliderAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         sliderAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@@ -159,11 +179,7 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         surveyToggleSlider.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    // Set global variables
-                } else {
-
-                }
+                videoProcessing = isChecked;
             }
         });
 
@@ -174,11 +190,12 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         final RelativeLayout audioLayout = new RelativeLayout(this);
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Audio Upload");
+        String textViewTempText = "Audio Upload";
+        surveyTitle.setText(textViewTempText);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(false);
+        surveyToggleSlider.setChecked(audioProcessing);
 
         RelativeLayout.LayoutParams sliderAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         sliderAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@@ -194,11 +211,7 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         surveyToggleSlider.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    // Set global variables
-                } else {
-
-                }
+                audioProcessing = isChecked;
             }
         });
 
@@ -209,11 +222,12 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         final RelativeLayout imageLayout  = new RelativeLayout(this);
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Image Upload");
+        String textViewTempText = "Image Upload";
+        surveyTitle.setText(textViewTempText);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(false);
+        surveyToggleSlider.setChecked(imageProcessing);
 
         RelativeLayout.LayoutParams sliderAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         sliderAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@@ -229,11 +243,7 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         surveyToggleSlider.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    // Set global variables
-                } else {
-
-                }
+                imageProcessing = isChecked;
             }
         });
 
@@ -248,11 +258,12 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         buttonLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Notifications");
+        String textViewTempText = "Notifications";
+        surveyTitle.setText(textViewTempText);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(false);
+        surveyToggleSlider.setChecked(customNotifications);
 
         notificationLabels.add(surveyTitle);
 
@@ -279,8 +290,10 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                 if (isChecked) {
                     notificationLayout.addView(buttonLayout);
+                    customNotifications = true;
                 } else {
                     notificationLayout.removeView(buttonLayout);
+                    customNotifications = false;
                 }
             }
         });
@@ -290,44 +303,198 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         return notificationLayout;
     }
 
-    private void createNewNotification(View v, final LinearLayout buttonLayout) {
+    private void createNewNotification(final View v, final LinearLayout buttonLayout) {
         final RelativeLayout relLayout = new RelativeLayout(this);
 
-        final TextView questionNumberLabel = new TextView(this);
-        questionNumberLabel.setId(uniqueID++);
+        final TextView notificationLabel = new TextView(this);
+        notificationLabel.setId(uniqueID++);
+
+        String textViewTempText = "Notification " + notificationLabels.size() + ":";
+        notificationLabel.setText(textViewTempText);
+
+        final TextView notificationMessageLabel = new TextView(this);
+        textViewTempText = "Notification Message:";
+        notificationMessageLabel.setText(textViewTempText);
+        notificationMessageLabel.setId(uniqueID++);
+
+        final EditText notificationMessageEditText = new EditText(this);
+        notificationMessageEditText.setId(uniqueID++);
+        notificationMessageEditText.setTextSize(9);
+
+        final TextView notificationTimeLabel = new TextView(this);
+        textViewTempText = "Time:";
+        notificationTimeLabel.setText(textViewTempText);
+        notificationTimeLabel.setId(uniqueID++);
+
+        DisplayMetrics displayMetrics = new DisplayMetrics();
+        getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
+        int width = displayMetrics.widthPixels;
+
+        final EditText notificationTimeEditText = new EditText(this);
+        notificationTimeEditText.setId(uniqueID++);
+        notificationTimeEditText.setTextSize(9);
+        notificationTimeEditText.setFocusable(false);
+        notificationTimeEditText.setClickable(true);
+        notificationTimeEditText.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Calendar currentTime = Calendar.getInstance();
+                int hour = currentTime.get(Calendar.HOUR_OF_DAY);
+                int minute = currentTime.get(Calendar.MINUTE);
+                TimePickerDialog mTimePicker;
+                mTimePicker = new TimePickerDialog(ExperimentSurveyCreatorActivity.this, new TimePickerDialog.OnTimeSetListener() {
+                    @Override
+                    public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
+                        String textViewTempText = selectedHour + ":" + selectedMinute;
+                        notificationTimeEditText.setText(textViewTempText);
+                    }
+                }, hour, minute, true);//Yes 24 hour time
+                mTimePicker.setTitle("Select Time");
+                mTimePicker.show();
+            }
+        });
 
-        String questionLabel = "Notification " + experimentQuestionLabels.size() + ":";
-        questionNumberLabel.setText(questionLabel);
+        final TextView notificationRepeatLabel = new TextView(this);
+        textViewTempText = "Repeat Every:";
+        notificationRepeatLabel.setText(textViewTempText);
+        notificationRepeatLabel.setId(uniqueID++);
+
+        final EditText notificationRepeatEditText = new EditText(this);
+        notificationRepeatEditText.setId(uniqueID++);
+        notificationRepeatEditText.setTextSize(9);
+        notificationRepeatEditText.setFocusable(false);
+        notificationRepeatEditText.setClickable(true);
+        notificationRepeatEditText.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Calendar currentTime = Calendar.getInstance();
+                int hour = currentTime.get(Calendar.HOUR_OF_DAY);
+                int minute = currentTime.get(Calendar.MINUTE);
+                TimePickerDialog mTimePicker;
+                mTimePicker = new TimePickerDialog(ExperimentSurveyCreatorActivity.this, new TimePickerDialog.OnTimeSetListener() {
+                    @Override
+                    public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
+                        String textViewTempText = selectedHour + ":" + selectedMinute+" hours";
+                        notificationRepeatEditText.setText(textViewTempText);
+                    }
+                }, hour, minute, true);//Yes 24 hour time
+                mTimePicker.setTitle("Select Time");
+                mTimePicker.show();
+            }
+        });
 
-        final EditText questionEdit = new EditText(this);
-        questionEdit.setId(uniqueID++);
-        questionEdit.setTextSize(9);
 
         RelativeLayout.LayoutParams hrAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);
-        hrAlignment.addRule(RelativeLayout.BELOW, questionNumberLabel.getId());
+        hrAlignment.addRule(RelativeLayout.BELOW, notificationLabel.getId());
 
-        View hrLocal = new View(ExperimentSurveyCreatorActivity.this);
-        ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);
-        hrLocal.setLayoutParams(hrLayoutParams);
-        hrLocal.setBackgroundColor(Color.parseColor("#888888"));
+        View hrLocal = ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 1, "#888888");
         hrLocal.setId(uniqueID++);
 
-        RelativeLayout.LayoutParams questionEditAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
-        questionEditAlignment.addRule(RelativeLayout.BELOW, hrLocal.getId());
+        RelativeLayout.LayoutParams notificationMessageLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationMessageLabelAlignment.addRule(RelativeLayout.BELOW, hrLocal.getId());
 
-        relLayout.addView(questionNumberLabel);
+        @SuppressWarnings("deprecation") RelativeLayout.LayoutParams notificationMessageEditTextAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationMessageEditTextAlignment.addRule(RelativeLayout.BELOW, hrLocal.getId());
+        notificationMessageEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, notificationMessageLabel.getId());
+
+        // Cannot do "Fill parent" below because they all share 1 line, and using one of them will fill parent pushes the others out
+
+        RelativeLayout.LayoutParams notificationTimeLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationTimeLabelAlignment.addRule(RelativeLayout.BELOW, notificationMessageEditText.getId());
+
+        RelativeLayout.LayoutParams notificationTimeEditTextAlignment = new RelativeLayout.LayoutParams(width/4, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationTimeEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, notificationTimeLabel.getId());
+        notificationTimeEditTextAlignment.addRule(RelativeLayout.BELOW, notificationMessageEditText.getId());
+
+        RelativeLayout.LayoutParams notificationRepeatLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationRepeatLabelAlignment.addRule(RelativeLayout.LEFT_OF, notificationRepeatEditText.getId());
+        notificationRepeatLabelAlignment.addRule(RelativeLayout.BELOW, notificationMessageEditText.getId());
+
+        RelativeLayout.LayoutParams notificationRepeatEditTextAlignment = new RelativeLayout.LayoutParams(width/4, ViewGroup.LayoutParams.WRAP_CONTENT);
+        notificationRepeatEditTextAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+        notificationRepeatEditTextAlignment.addRule(RelativeLayout.BELOW, notificationMessageEditText.getId());
+
+        relLayout.addView(notificationLabel);
         relLayout.addView(hrLocal, hrAlignment);
-        relLayout.addView(questionEdit, questionEditAlignment);
+        relLayout.addView(notificationMessageLabel, notificationMessageLabelAlignment);
+        relLayout.addView(notificationMessageEditText, notificationMessageEditTextAlignment);
+        relLayout.addView(notificationTimeLabel, notificationTimeLabelAlignment);
+        relLayout.addView(notificationTimeEditText, notificationTimeEditTextAlignment);
+        relLayout.addView(notificationRepeatLabel, notificationRepeatLabelAlignment);
+        relLayout.addView(notificationRepeatEditText, notificationRepeatEditTextAlignment);
+
+        final Button deleteNotificationButton = new Button(this);
+        textViewTempText = "x";
+        deleteNotificationButton.setText(textViewTempText);
+        deleteNotificationButton.setId(uniqueID++);
+        deleteNotificationButton.setGravity(Gravity.CENTER);
+
+        final Button addNotificationButton = new Button(this);
+        textViewTempText = "Add Notification";
+        addNotificationButton.setText(textViewTempText);
+
+        RelativeLayout.LayoutParams deleteQuestionButtonAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        deleteQuestionButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_TOP);
+        deleteQuestionButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+
+        if(notificationLabels.size() > 1) relLayout.addView(deleteNotificationButton, deleteQuestionButtonAlignment);
 
         buttonLayout.addView(relLayout);
-    }
 
-    private View newHR(int thickness) {
-        View hrTemp = new View(ExperimentSurveyCreatorActivity.this);
-        ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, thickness);
-        hrTemp.setLayoutParams(hrLayoutParams);
-        hrTemp.setBackgroundColor(Color.parseColor("#888888"));
-        return hrTemp;
+        notificationLabels.add(notificationLabel);
+        notificationMessageEditTexts.add(notificationMessageEditText);
+        notificationTimeEditTexts.add(notificationTimeEditText);
+        notificationRepeatEditTexts.add(notificationRepeatEditText);
+
+
+        deleteNotificationButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v2) {
+                ViewGroup tempViewGroup = (ViewGroup) v2.getParent();
+                tempViewGroup.removeAllViews();
+                notificationLabels.remove(notificationLabel);
+                notificationMessageEditTexts.remove(notificationMessageEditText);
+                notificationTimeEditTexts.remove(notificationTimeEditText);
+                notificationRepeatEditTexts.remove(notificationRepeatEditText);
+                String textViewTempText;
+
+                addNotificationButton.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v3) {
+                        String textViewTempText;
+                        for(int i = 1; i < notificationLabels.size(); i++){
+                            textViewTempText = "Notification "+(i)+":";
+                            notificationLabels.get(i).setText(textViewTempText);
+                        }
+                        createNewNotification(v3, buttonLayout);
+                    }
+                });
+
+                for(int i = 1; i < notificationLabels.size(); i++){
+                    textViewTempText = "Notification "+(i)+":";
+                    notificationLabels.get(i).setText(textViewTempText);
+                }
+            }
+        });
+
+        addNotificationButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v2) {
+                for(int i = 1; i < notificationLabels.size(); i++){
+                    String textViewTempText = "Notification "+(i)+":";
+                    notificationLabels.get(i).setText(textViewTempText);
+                }
+                createNewNotification(v2, buttonLayout);
+            }
+        });
+
+        if(v.isClickable()){
+            buttonLayout.removeView(v);
+            buttonLayout.addView(addNotificationButton);
+        } else{
+            buttonLayout.addView(addNotificationButton);
+        }
+
     }
 
     private void createNewQuestion(View v, final LinearLayout buttonLayout){
@@ -336,74 +503,70 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         final TextView questionNumberLabel = new TextView(this);
         questionNumberLabel.setId(uniqueID++);
 
-        String questionLabel = "Question " + experimentQuestionLabels.size() + ":";
-        questionNumberLabel.setText(questionLabel);
+        String textViewTempText = "Question " + questionLabels.size() + ":";
+        questionNumberLabel.setText(textViewTempText);
 
-        final EditText questionEdit = new EditText(this);
-        questionEdit.setId(uniqueID++);
-        questionEdit.setTextSize(9);
+        final EditText questionEditText = new EditText(this);
+        questionEditText.setId(uniqueID++);
+        questionEditText.setTextSize(9);
 
         RelativeLayout.LayoutParams questionEditAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         questionEditAlignment.addRule(RelativeLayout.RIGHT_OF, questionNumberLabel.getId());
 
         relLayout.addView(questionNumberLabel);
-        relLayout.addView(questionEdit, questionEditAlignment);
+        relLayout.addView(questionEditText, questionEditAlignment);
 
         final Button deleteQuestionButton = new Button(this);
-        deleteQuestionButton.setText("x");
+        textViewTempText = "x";
+        deleteQuestionButton.setText(textViewTempText);
         deleteQuestionButton.setId(uniqueID++);
         deleteQuestionButton.setGravity(Gravity.CENTER);
 
+        final Button addQuestionButton = new Button(this);
+        textViewTempText = "Add Question";
+        addQuestionButton.setText(textViewTempText);
+
         RelativeLayout.LayoutParams deleteQuestionButtonAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         deleteQuestionButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_TOP);
         deleteQuestionButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
 
-        if(experimentQuestionLabels.size() > 1) relLayout.addView(deleteQuestionButton, deleteQuestionButtonAlignment);
+        if(questionLabels.size() > 1) relLayout.addView(deleteQuestionButton, deleteQuestionButtonAlignment);
 
         buttonLayout.addView(relLayout);
 
-        deleteQuestionButtons.add(deleteQuestionButton);
+        questionLabels.add(questionNumberLabel);
+        questionEditTexts.add(questionEditText);
 
         deleteQuestionButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v2) {
-                // All works perfectly to this point, next move is to change the index of addbutton to decrement
                 ViewGroup tempViewGroup = (ViewGroup) v2.getParent();
                 tempViewGroup.removeAllViews();
-                deleteQuestionButtons.get(deleteQuestionButtons.indexOf(deleteQuestionButton)-1).setVisibility(View.VISIBLE);
-                deleteQuestionButtons.remove(deleteQuestionButtons.size()-1);
-                //if(deleteQuestionButtons.size()-1 >= 0) deleteQuestionButtons.remove(deleteQuestionButtons.size()-1);
 
+                questionEditTexts.remove(questionEditText);
+                questionLabels.remove(questionNumberLabel);
+
+                addQuestionButton.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v3) {
+                        for(int i = 1; i < questionLabels.size(); i++){
+                            String textViewTempText = "Question " + (i) + ":";
+                            questionLabels.get(i).setText(textViewTempText);
+                        }
+                        createNewQuestion(v3, buttonLayout);
+                    }
+                });
 
-                experimentQuestions.remove(questionEdit);
-                experimentQuestionLabels.remove(questionNumberLabel);
-                experimentQuestions.remove(experimentQuestions.size()-1);
-                experimentQuestionLabels.remove(experimentQuestionLabels.size()-1);
-                d("deleteButton", String.valueOf(deleteQuestionButtons.size()));
+                for(int i = 1; i < questionLabels.size(); i++){
+                    String textViewTempText = "Question " + (i) + ":";
+                    questionLabels.get(i).setText(textViewTempText);
+                }
             }
         });
 
-
-        final Button addQuestionButton = new Button(this);
-        addQuestionButton.setText("Add Question");
-
         addQuestionButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v2) {
-
-                // Because I couldn't figure out how to fix this bug, this will be the method I do this with
-                if(deleteQuestionButtons.indexOf(deleteQuestionButton) != 0 && deleteQuestionButtons.indexOf(deleteQuestionButton) != -1){
-                    deleteQuestionButton.setVisibility(View.INVISIBLE);
-                    for(int i = 0; i < deleteQuestionButtons.size(); i++){
-                        deleteQuestionButtons.get(i).setVisibility(View.INVISIBLE);
-                    }
-                }
-
-                experimentQuestions.add(questionEdit);
-                experimentQuestionLabels.add(questionNumberLabel);
-
-                d("deleteCount", String.valueOf(deleteQuestionButtons.size()));
-
                 createNewQuestion(v2, buttonLayout);
             }
         });
@@ -414,8 +577,6 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         } else{
             buttonLayout.addView(addQuestionButton);
         }
-
-
     }
 
     private View surveyDataLayout() {
@@ -426,13 +587,14 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         buttonLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
 
         TextView surveyTitle = new TextView(this);
-        surveyTitle.setText("Survey");
+        String textViewTempText = "Survey";
+        surveyTitle.setText(textViewTempText);
         surveyTitle.setId(uniqueID++);
 
         Switch surveyToggleSlider = new Switch(this);
-        surveyToggleSlider.setChecked(true);
+        surveyToggleSlider.setChecked(surveyQuestions);
 
-        experimentQuestionLabels.add(surveyTitle);
+        questionLabels.add(surveyTitle);
 
         RelativeLayout.LayoutParams sliderAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
         sliderAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
@@ -456,8 +618,10 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                 if (isChecked) {
                     surveyLayout.addView(buttonLayout);
+                    surveyQuestions = true;
                 } else {
                     surveyLayout.removeView(buttonLayout);
+                    surveyQuestions = false;
                 }
             }
         });
@@ -482,7 +646,7 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
 
             JSONObject experimentObject = boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex", 0));
 
-            staticMetaDataLayout.addView(newHR(4));
+            staticMetaDataLayout.addView(ProjectMacros.newHR(ExperimentSurveyCreatorActivity.this, 4, "#888888"));
 
             TextView groupTitle = new TextView(this);
             groupTitle.setText(experimentObject.getString("Group"));
@@ -499,23 +663,22 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
 
             staticMetaDataLayout.addView(experimentTitle);
             staticMetaDataLayout.addView(experimentDesc);
-
-            staticMetaDataLayout.addView(newHR(4));
         } catch (Exception e){
             e.printStackTrace();
         }
         return staticMetaDataLayout;
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     private void titleBarInit(JSONObject boxInfo) {
         try{
             if(!boxInfo.getString("Image").matches("null")){
                 Drawable yourDrawable;
                 InputStream inputStream = getContentResolver().openInputStream(Uri.parse(boxInfo.getString("Image")));
                 yourDrawable = Drawable.createFromStream(inputStream, boxInfo.getString("Image"));
-                getSupportActionBar().setLogo(yourDrawable);
+                Objects.requireNonNull(getSupportActionBar()).setLogo(yourDrawable);
             } else{
-                getSupportActionBar().setLogo(R.mipmap.ic_launcher);
+                Objects.requireNonNull(getSupportActionBar()).setLogo(R.mipmap.ic_launcher);
             }
             setTitle(boxInfo.getString("Name"));
         }catch (Exception e){
@@ -523,63 +686,119 @@ public class ExperimentSurveyCreatorActivity extends AppCompatActivity {
         }
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     private void submitCheck() {
-        try{
-            JSONObject boxInfo = new JSONObject(getIntent().getStringExtra("JSON"));
+        try {
+            JSONObject boxInfo = new JSONObject(Objects.requireNonNull(getIntent().getStringExtra("JSON")));
             Intent openPage = new Intent(ExperimentSurveyCreatorActivity.this, ExperimentSurveyCreatorActivity.class);
-            //d("sub", boxInfo.getJSONArray("Experiments").toString());
+
             openPage.putExtra("JSON", getIntent().getStringExtra("JSON"));
 
             JSONObject groupJSON = boxInfo.getJSONArray("Experiments").getJSONObject(getIntent().getIntExtra("GroupIndex", 0));
-            JSONArray experimentJSON = groupJSON.getJSONArray("Options");
+            JSONArray experimentsJSON = groupJSON.getJSONArray("Options");
+            JSONObject currentExperimentJSON = experimentsJSON.getJSONObject(getIntent().getIntExtra("ExperimentIndex", 0));
+
+            d("dbg_experimentLength", String.valueOf(experimentsJSON.length()));
+            d("dbg_experimentIndex", String.valueOf(getIntent().getIntExtra("ExperimentIndex", 0)));
+
+            d("dbg_json", boxInfo.toString());
+
+            d("dbg_oldExperiment", currentExperimentJSON.toString());
 
+            boolean completedJSON = true;
 
-            // test for git commit
+            currentExperimentJSON.put("VideoProcessing", videoProcessing);
+            currentExperimentJSON.put("AudioProcessing", audioProcessing);
+            currentExperimentJSON.put("ImageProcessing", imageProcessing);
 
-            d("experimentLength", String.valueOf(experimentJSON.length()));
-            d("experimentIndex", String.valueOf(getIntent().getIntExtra("ExperimentIndex", 0)));
+            if (surveyQuestions) {
+                JSONArray surveyJSONArray = new JSONArray();
+                for (int i = 0; i < questionEditTexts.size(); i++) {
+                    if(questionEditTexts.get(i).getText().toString().matches("")) completedJSON = false;
+                    surveyJSONArray.put(questionEditTexts.get(i).getText());
+                }
+                currentExperimentJSON.put("SurveyQuestions", surveyJSONArray);
+            } else {
+                JSONArray surveyJSONArray = new JSONArray();
+                surveyJSONArray.put(JSONObject.NULL);
+                currentExperimentJSON.put("SurveyQuestions", surveyJSONArray);
+            }
 
-            if(getIntent().getIntExtra("ExperimentIndex", 0)+1 >= experimentJSON.length()){ // Check if moving out of group
+
+            if (customNotifications) {
+                JSONArray notificationsJSONArray = new JSONArray();
+                for (int i = 0; i < notificationMessageEditTexts.size(); i++) {
+                    if (notificationMessageEditTexts.get(i).getText().toString().matches("")) completedJSON = false;
+                    if (notificationTimeEditTexts.get(i).getText().toString().matches("")) completedJSON = false;
+                    if (notificationRepeatEditTexts.get(i).getText().toString().matches("")) completedJSON = false;
+                    if(completedJSON){
+                        JSONObject notificationJSONObject = new JSONObject();
+                        notificationJSONObject.put("Message", notificationMessageEditTexts.get(i).getText());
+                        notificationJSONObject.put("Time", notificationTimeEditTexts.get(i).getText());
+                        notificationJSONObject.put("Repeat", notificationRepeatEditTexts.get(i).getText().subSequence(0, 5));
+                        notificationsJSONArray.put(notificationJSONObject);
+                        currentExperimentJSON.put("Notification", notificationsJSONArray);
+                    }
+                }
+            }
+
+            // Stretch goal to allow for the user to select "which" artefact is enabled (i.e. only available is the salt shaker)
+            currentExperimentJSON.put("ArtefactImplementation", artefactImplementation);
+
+            d("dbg_updateExperiment", currentExperimentJSON.toString());
+
+            if (getIntent().getIntExtra("ExperimentIndex", 0) + 1 >= experimentsJSON.length() && completedJSON) {
                 openPage.putExtra("ExperimentIndex", 0);
-                if(getIntent().getIntExtra("GroupIndex", 0)+1 >= boxInfo.getJSONArray("Experiments").length()){
-                    d("sub", "end of json check 1");
+                if (getIntent().getIntExtra("GroupIndex", 0) + 1 >= boxInfo.getJSONArray("Experiments").length()) {
+                    d("dbg_sub", "end of json check 1");
                     allSurveyCompleted(boxInfo);
-                } else{
-                    d("sub", "end of group");
-                    openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0)+1);
+                } else {
+                    d("dbg_sub", "end of group");
+                    openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0) + 1);
                     startActivity(openPage);
                 }
-            } else if (getIntent().getIntExtra("GroupIndex", 0)+1 >= boxInfo.getJSONArray("Experiments").length()) {
-                if(getIntent().getIntExtra("ExperimentIndex", 0) < experimentJSON.length()){
-                    d("sub", "remain in the same group");
+            } else if (getIntent().getIntExtra("GroupIndex", 0) + 1 >= boxInfo.getJSONArray("Experiments").length()  && completedJSON) {
+                if (getIntent().getIntExtra("ExperimentIndex", 0) < experimentsJSON.length()) {
+                    d("dbg_sub", "remain in the same group");
                     openPage.putExtra("ExperimentIndex", getIntent().getIntExtra("ExperimentIndex", 0) + 1);
                     openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0));
                     startActivity(openPage);
-                } else{
-                    d("sub", "end of json check 2");
+                } else {
+                    d("dbg_sub", "end of json check 2");
                     allSurveyCompleted(boxInfo);
                 }
-            } else {
-                d("sub", "remain in the same group");
+            } else if(completedJSON) {
+                d("dbg_sub", "remain in the same group");
                 openPage.putExtra("ExperimentIndex", getIntent().getIntExtra("ExperimentIndex", 0) + 1);
                 openPage.putExtra("GroupIndex", getIntent().getIntExtra("GroupIndex", 0));
                 startActivity(openPage);
+            } else{
+                try {
+                    if (!submitToast.getView().isShown()) {
+                        // Update when should be shown
+                        submitToast = Toast.makeText(getApplicationContext(), "Need to complete all the information!", Toast.LENGTH_SHORT);
+                        submitToast.show();
+                    }
+                } catch (Exception e) {
+                    // First creation
+                    submitToast = Toast.makeText(getApplicationContext(), "Need to complete all the information!", Toast.LENGTH_SHORT);
+                    submitToast.show();
+                }
             }
         } catch(JSONException e){
             e.printStackTrace();
         }
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     private void allSurveyCompleted(JSONObject boxInfo) {
-        // do the thing with saving into the current JSON, then return to the box page and show the new file (close every previous page if possible and launch new activity)
-        // Try, in order to avoid errors in compilation and catastrophic errors
         JSONArray boxes;
         try {
             boxes = new JSONArray(FileStoreReader.readFile(ExperimentSurveyCreatorActivity.this, "boxData.json"));
 
             boxes.put(boxInfo);
 
-            d("UpdatedJSON", boxes.toString());
+            d("dbg_UpdatedJSON", boxes.toString());
 
             FileStoreReader.saveFile(ExperimentSurveyCreatorActivity.this, "boxData.json", boxes.toString());
 
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/FileStoreReader.java b/app/src/main/java/com/yearthreeproject/xbframework/FileStoreReader.java
index 44f8b1b..4b27b64 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/FileStoreReader.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/FileStoreReader.java
@@ -1,6 +1,9 @@
 package com.yearthreeproject.xbframework;
 
 import android.content.Context;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -10,16 +13,19 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+
+import static android.util.Log.d;
 
-public class FileStoreReader {
+class FileStoreReader {
 
-    public static void saveFile(Context intentContext, String title, String data){
+    static void saveFile(Context intentContext, String title, String data){
 
         // Check if file exists and if not, create
         File file = new File(intentContext.getFilesDir(), title);
         if(!file.exists()) {
             try {
-                file.createNewFile();
+                if(file.createNewFile()) d("dbg_create", "Successfully created the file!");
             } catch (IOException e) {
                 e.printStackTrace();
             }
@@ -37,10 +43,11 @@ public class FileStoreReader {
     }
 
 
-    public static String readFile(Context context, String filename) {
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+    static String readFile(Context context, String filename) {
         try {
             FileInputStream fis = context.openFileInput(filename);
-            InputStreamReader isr = new InputStreamReader(fis, "UTF-8");
+            InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
             BufferedReader bufferedReader = new BufferedReader(isr);
             StringBuilder sb = new StringBuilder();
             String line;
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/LoginActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/LoginActivity.java
index 00b4704..2023f5c 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/LoginActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/LoginActivity.java
@@ -1,39 +1,39 @@
 package com.yearthreeproject.xbframework;
 
+import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.Button;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 
-import static android.util.Log.d;
+import java.util.Objects;
 
 public class LoginActivity extends AppCompatActivity {
 
-    private Button submitLoginButton, backHomeButton;
-    private Toolbar toolbar;
-
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_login);
 
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
-        submitLoginButton = (Button) findViewById(R.id.LoginSubmitButton);
+        Button submitLoginButton = findViewById(R.id.LoginSubmitButton);
         submitLoginButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 //TODO: implement what happens on submitting login
             }
         });
 
-        backHomeButton = (Button) findViewById(R.id.LoginBackHomeButton);
+        Button backHomeButton = findViewById(R.id.LoginBackHomeButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/MainActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/MainActivity.java
index dd5f67e..dec82a0 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/MainActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/MainActivity.java
@@ -1,6 +1,7 @@
 package com.yearthreeproject.xbframework;
 
 import android.Manifest;
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -29,20 +30,20 @@ import org.json.JSONObject;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.InputStream;
+import java.util.Objects;
 import java.util.Random;
 
 import static android.util.Log.d;
 
 public class MainActivity extends AppCompatActivity {
 
-    private Button homeButton, loginButton, shopButton, experimentsButton, progressButton, aboutButton, surveyButton;
-    private Toolbar toolbar;
     private boolean shouldRecreate;
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         MenuItem createBox = menu.add("Reset JSON!");
         createBox.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
+            @RequiresApi(api = Build.VERSION_CODES.KITKAT)
             @Override
             public boolean onMenuItemClick(MenuItem item) {
                 resetBoxJSON();
@@ -52,35 +53,41 @@ public class MainActivity extends AppCompatActivity {
         return true;
     }
 
+    @SuppressLint("NewApi")
     @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
 
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
-        getSupportActionBar().setLogo(R.mipmap.ic_launcher);
-        getSupportActionBar().setDisplayUseLogoEnabled(true);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
+        }
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+            Objects.requireNonNull(getSupportActionBar()).setLogo(R.mipmap.ic_launcher);
+        }
+        Objects.requireNonNull(getSupportActionBar()).setDisplayUseLogoEnabled(true);
 
         askForWriteAccess();
         createSalt();
         checkLocalUserFile();
 
-        homeButton = findViewById(R.id.HomeHomeButton);
-        loginButton = findViewById(R.id.HomeLoginButton);
-        shopButton = findViewById(R.id.HomeShopButton);
-        experimentsButton = findViewById(R.id.HomeExperimentsButton);
-        progressButton = findViewById(R.id.HomeProgressButton);
-        aboutButton = findViewById(R.id.HomeAboutButton);
-        surveyButton = findViewById(R.id.HomeSurveyButton);
+        Button homeButton = findViewById(R.id.HomeHomeButton);
+        Button loginButton = findViewById(R.id.HomeLoginButton);
+        Button shopButton = findViewById(R.id.HomeShopButton);
+        Button experimentsButton = findViewById(R.id.HomeExperimentsButton);
+        Button progressButton = findViewById(R.id.HomeProgressButton);
+        Button aboutButton = findViewById(R.id.HomeAboutButton);
+        Button surveyButton = findViewById(R.id.HomeSurveyButton);
 
         LinearLayout homeActLay = findViewById(R.id.HomeActivityLayout);
         homeActLay.removeView(homeButton);
 
         Button testingButton = new Button(this);
-        testingButton.setText("Testing");
+        String textViewTempText = "Developer";
+        testingButton.setText(textViewTempText);
         homeActLay.addView(testingButton);
         testingButton.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -90,22 +97,28 @@ public class MainActivity extends AppCompatActivity {
         });
 
         try {
-            JSONObject localUserJSON = new JSONObject(FileStoreReader.readFile(this, "localUserData.json"));
-            d("testing", localUserJSON.toString());
+            JSONObject localUserJSON = null;
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+                localUserJSON = new JSONObject(FileStoreReader.readFile(this, "localUserData.json"));
+            }
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+                d("dbg_testing", Objects.requireNonNull(localUserJSON).toString());
+            }
+            assert localUserJSON != null;
             if(localUserJSON.get("savedUserID") != JSONObject.NULL){
-                d("test", "got user id");
+                d("dbg_test", "got user id");
                 homeActLay.removeView(loginButton);
             } else{
-                d("test", "do not got user id");
+                d("dbg_test", "do not got user id");
                 homeActLay.removeAllViews();
                 homeActLay.addView(loginButton);
             }
 
-            if(localUserJSON.opt("locked") != JSONObject.NULL && localUserJSON.optBoolean("locked") == true){
-                d("test", "is locked to experiment"+localUserJSON.opt("locked").toString());
+            if(localUserJSON.opt("locked") != JSONObject.NULL && localUserJSON.optBoolean("locked")){
+                d("dbg_test", "is locked to experiment"+ Objects.requireNonNull(localUserJSON.opt("locked")).toString());
                 homeActLay.removeView(experimentsButton);
             } else{
-                d("test", "is not locked to experiment");
+                d("dbg_test", "is not locked to experiment");
                 homeActLay.removeView(surveyButton);
 
             }
@@ -118,7 +131,7 @@ public class MainActivity extends AppCompatActivity {
 
         homeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
-                d("testing", "When is this used?");
+                d("dbg_testing", "When is this used?");
             }
         });
 
@@ -166,8 +179,6 @@ public class MainActivity extends AppCompatActivity {
         if(!file.exists()) {
             // Do stuff to initialise the file
             FileStoreReader.saveFile(this, "localUserData.json", "{\"d\":\"01/31/1999\",\"savedUserID\":\"A01\"}");
-        } else {
-            // Do nothing
         }
     }
 
@@ -188,10 +199,11 @@ public class MainActivity extends AppCompatActivity {
             savedSettingsEditor.putString("Salt", saltString.toString());
             savedSettingsEditor.apply();
         } else {
-            d("Salt", savedSettings.getString("Salt", ""));
+            d("dbg_Salt", savedSettings.getString("Salt", ""));
         }
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     private void resetBoxJSON() {
         // Load Box Json and initialise to internal storage
         InputStream inputStream = getResources().openRawResource(R.raw.box);
@@ -215,8 +227,8 @@ public class MainActivity extends AppCompatActivity {
 
         FileStoreReader.saveFile(this, "localUserData.json", "{\"dateUntil\": \"01/31/1999\",\n\"savedUserID\": \"A01\",\n\"locked\": false}");
 
-        d("file", FileStoreReader.readFile(this, "boxData.json"));
-        d("file", FileStoreReader.readFile(this, "localUserData.json"));
+        d("dbg_file", FileStoreReader.readFile(this, "boxData.json"));
+        d("dbg_file", FileStoreReader.readFile(this, "localUserData.json"));
 
         recreate();
     }
@@ -246,6 +258,7 @@ public class MainActivity extends AppCompatActivity {
     }
 
     // Image permission check
+    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
     private void askForWriteAccess() {
         if (ContextCompat.checkSelfPermission(MainActivity.this,
                 Manifest.permission.WRITE_EXTERNAL_STORAGE)
@@ -273,7 +286,7 @@ public class MainActivity extends AppCompatActivity {
                         1);
             }
         } else {
-            d("Perm", "Already granted");
+            d("dbg_Perm", "Already granted");
         }
 
         if (ContextCompat.checkSelfPermission(MainActivity.this,
@@ -302,7 +315,7 @@ public class MainActivity extends AppCompatActivity {
                         1);
             }
         } else {
-            d("Perm", "Already granted");
+            d("dbg_Perm", "Already granted");
         }
     }
 
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/MyNotificationPublisher.java b/app/src/main/java/com/yearthreeproject/xbframework/MyNotificationPublisher.java
index 4842aa6..a562927 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/MyNotificationPublisher.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/MyNotificationPublisher.java
@@ -8,8 +8,9 @@ import android.content.Context;
 import android.content.Intent;
 
 public class MyNotificationPublisher extends BroadcastReceiver {
-    public static String NOTIFICATION_ID = "notification-id" ;
-    public static String NOTIFICATION = "notification" ;
+    final public static String NOTIFICATION_ID = "notification-id";
+    final public static String NOTIFICATION = "notification";
+
     public void onReceive (Context context , Intent intent) {
         NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context. NOTIFICATION_SERVICE ) ;
         Notification notification = intent.getParcelableExtra( NOTIFICATION ) ;
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/NewBox.java b/app/src/main/java/com/yearthreeproject/xbframework/NewBox.java
index bd3386a..d89b9ea 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/NewBox.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/NewBox.java
@@ -4,7 +4,6 @@ import android.Manifest;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.PackageManager;
-import android.graphics.Color;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
@@ -20,6 +19,7 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -46,22 +46,21 @@ import java.util.Objects;
 
 import static android.util.Log.d;
 
-
-// TODO: For layout cleanup, look into relative layouts
-
-
 public class NewBox extends AppCompatActivity {
 
     private Uri imageUploadResultUri;
-    private List<EditText> groupTitlesArray = new ArrayList<>();
-    private List<List<EditText>> experimentTitlesArray = new ArrayList<>();
-    private List<List<EditText>> experimentDescriptionsArray = new ArrayList<>();
-    private List<List<EditText>> experimentInstructionsArray = new ArrayList<>();
+
+    final private List<EditText> groupTitlesArray = new ArrayList<>();
+    final private List<List<EditText>> experimentTitlesArray = new ArrayList<>();
+    final private List<List<EditText>> experimentDescriptionsArray = new ArrayList<>();
+    final private List<List<EditText>> experimentInstructionsArray = new ArrayList<>();
+
     private ImageView uploadImageButton;
-    private int globalGroupIndex = 1;
+    private int globalGroupIndex = 0;
     private String inFiveValue = "Select a MEECS...";
     private boolean imageUploaded = false;
     private Toast submitToast;
+    private int uniqueId = 1;
 
     @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
@@ -99,51 +98,43 @@ public class NewBox extends AppCompatActivity {
                 // Do nothing
             }
         });
-
         uploadImageButton.setMaxHeight(uploadImageButton.getHeight());
-
-
         uploadImageButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-
                 imagePermissionCheckFunction();
             }
         });
 
-        Button addExperimentButton = findViewById(R.id.GroupOneAddExperimentButton);
-        addExperimentButton.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                addExperimentFunction(v, 0);
-            }
-        });
+        final LinearLayout scrollLayout = findViewById(R.id.InputDataScrollableLayout);
 
-        Button submitButton = findViewById(R.id.NewBoxSubmitButton);
-        Button addGroupButton = findViewById(R.id.AddExperimentGroupButton);
+        scrollLayout.addView(addGroupFunction(globalGroupIndex));
 
-        EditText groupOneTitleEditText = findViewById(R.id.GroupOneTitleEditText);
+        Button addNewGroupButton = new Button(this);
+        String textViewTempText = "Add Group";
+        addNewGroupButton.setText(textViewTempText);
 
-        groupTitlesArray.add(groupOneTitleEditText);
+        scrollLayout.addView(addNewGroupButton);
 
-        submitButton.setOnClickListener(new View.OnClickListener() {
+        addNewGroupButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                submitNewBoxFunction();
+                scrollLayout.removeView(v);
+                scrollLayout.addView(addGroupFunction(++globalGroupIndex));
+                scrollLayout.addView(v);
+                d("dbg_numOfGroupTitles", String.valueOf(groupTitlesArray.size()));
             }
         });
 
-        addGroupButton.setOnClickListener(new View.OnClickListener() {
+        Button submitButton = findViewById(R.id.NewBoxSubmitButton);
+        submitButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                addGroupFunction(v, globalGroupIndex);
+                submitNewBoxFunction();
             }
         });
-
-
     }
 
-    // Submit function
     private void submitNewBoxFunction() {
         boolean completedInfo = true;
         String toastText = "Need to fill out all the information to be able to submit box for review";
@@ -224,7 +215,7 @@ public class NewBox extends AppCompatActivity {
                 box.put("WarningText", tempEditTextForStringRetrieval.getText().toString());
 
                 JSONArray experimentGroups = new JSONArray();
-                for (int i = 0; i < globalGroupIndex; i++) {
+                for (int i = 0; i < groupTitlesArray.size(); i++) {
                     JSONObject experimentGroupInfo = new JSONObject();
 
                     experimentGroupInfo.put("Group", groupTitlesArray.get(i).getText().toString());
@@ -248,6 +239,7 @@ public class NewBox extends AppCompatActivity {
                 openPage.putExtra("JSON", box.toString());
                 openPage.putExtra("ExperimentIndex", 0);
                 openPage.putExtra("GroupIndex", 0);
+                d("dbg_json", box.toString());
                 startActivity(openPage);
             } catch (JSONException e) {
                 e.printStackTrace();
@@ -267,7 +259,6 @@ public class NewBox extends AppCompatActivity {
         }
     }
 
-    // Image permission check
     @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
     private void imagePermissionCheckFunction() {
         if (ContextCompat.checkSelfPermission(NewBox.this,
@@ -296,89 +287,78 @@ public class NewBox extends AppCompatActivity {
                         1);
             }
         } else {
-            d("Perm", "Already granted");
+            d("dbg_Perm", "Already granted");
             startImageUpload();
         }
     }
 
-    // Add group button function
-    private void addGroupFunction(View v, final int localGroupIndex) {
-        final LinearLayout experimentInfoLayout = findViewById(R.id.ExperimentsInfoLayout);
-
-                /*
-                Linear Layout (Vertical)
-                    LL (Horizontal)
-                        LL (Vert1)        LL (Vert2)
-                        Text(Group 2)     Button(Delete)
-                        Text(Title)       TextEdit(Group Title)
-                        Text(Experiments) Button(Add Experiment)
-                    View(HR)
-                 */
-
-        final LinearLayout experimentGroupLayout = new LinearLayout(NewBox.this);
-        experimentGroupLayout.setOrientation(LinearLayout.VERTICAL);
+    private LinearLayout addGroupFunction(final int localGroupIndex) {
+        final LinearLayout linearGroupLayout = new LinearLayout(this);
+        linearGroupLayout.setOrientation(LinearLayout.VERTICAL);
+        linearGroupLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
 
-        LinearLayout groupSettingsLayout = new LinearLayout(NewBox.this);
-        groupSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
-
-        LinearLayout groupDataTextViewLayout = new LinearLayout(NewBox.this);
-        groupDataTextViewLayout.setOrientation(LinearLayout.VERTICAL);
-        groupDataTextViewLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT));
-
-        LinearLayout groupDataEditTextLayout = new LinearLayout(NewBox.this);
-        groupDataEditTextLayout.setOrientation(LinearLayout.VERTICAL);
-        groupDataEditTextLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
+        final RelativeLayout relativeGroupLayout = new RelativeLayout(this);
 
         TextView titleTextView = new TextView(NewBox.this);
-        titleTextView.setText("Title:");
-        titleTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1));
+        String textViewTempText = "Group Title:";
+        titleTextView.setText(textViewTempText);
         titleTextView.setGravity(Gravity.CENTER_VERTICAL);
-        groupDataTextViewLayout.addView(titleTextView);
+        titleTextView.setId(uniqueId++);
 
         final EditText titleEditText = new EditText(NewBox.this);
-        titleEditText.setHint("Group Title");
+        titleEditText.setHint(textViewTempText.substring(0,11));
         titleEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
-        titleEditText.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
-
-        groupTitlesArray.add(titleEditText);
-        groupDataEditTextLayout.addView(titleEditText);
+        titleEditText.setId(uniqueId++);
 
         Button deleteGroupButton = new Button(NewBox.this);
-        deleteGroupButton.setText("Delete Group");
+        textViewTempText = "x";
+        deleteGroupButton.setText(textViewTempText);
+        deleteGroupButton.setId(uniqueId++);
 
-        TextView experimentsTextView = new TextView(NewBox.this);
-        experimentsTextView.setText("Experiments:");
-        experimentsTextView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1));
+        final TextView experimentsTextView = new TextView(NewBox.this);
+        textViewTempText = "Experiments:";
+        experimentsTextView.setText(textViewTempText);
         experimentsTextView.setGravity(Gravity.CENTER_VERTICAL);
-        groupDataTextViewLayout.addView(experimentsTextView);
+        experimentsTextView.setId(uniqueId++);
 
-        Button addExperimentToGroupButton = new Button(NewBox.this);
-        addExperimentToGroupButton.setText("Add Experiment");
-        addExperimentToGroupButton.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
+        final Button addExperimentToGroupButton = new Button(NewBox.this);
+        textViewTempText = "Add Experiment";
+        addExperimentToGroupButton.setText(textViewTempText);
+        addExperimentToGroupButton.setId(uniqueId++);
 
-        addExperimentToGroupButton.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                addExperimentFunction(v, localGroupIndex);
-            }
-        });
+        RelativeLayout.LayoutParams groupTitleLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        groupTitleLabelAlignment.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
+        groupTitleLabelAlignment.addRule(RelativeLayout.ALIGN_PARENT_TOP);
 
-        groupDataEditTextLayout.addView(addExperimentToGroupButton);
+        RelativeLayout.LayoutParams groupTitleEditTextAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        groupTitleEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, titleTextView.getId());
 
-        groupSettingsLayout.addView(groupDataTextViewLayout);
-        groupSettingsLayout.addView(groupDataEditTextLayout);
+        RelativeLayout.LayoutParams groupExperimentsLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        groupExperimentsLabelAlignment.addRule(RelativeLayout.BELOW, titleEditText.getId());
 
-        experimentGroupLayout.addView(groupSettingsLayout);
-        experimentGroupLayout.addView(deleteGroupButton);
+        RelativeLayout.LayoutParams deleteGroupButtonAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        deleteGroupButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+        deleteGroupButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_TOP);
 
-        View hr = new View(NewBox.this);
-        ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 4);
-        hr.setLayoutParams(hrLayoutParams);
-        hr.setBackgroundColor(Color.parseColor("#888888"));
+        relativeGroupLayout.addView(titleTextView, groupTitleLabelAlignment);
+        relativeGroupLayout.addView(titleEditText, groupTitleEditTextAlignment);
+        relativeGroupLayout.addView(experimentsTextView, groupExperimentsLabelAlignment);
+        if(groupTitlesArray.size() > 0) relativeGroupLayout.addView(deleteGroupButton, deleteGroupButtonAlignment);
 
-        experimentGroupLayout.addView(hr);
+        groupTitlesArray.add(titleEditText);
+        experimentTitlesArray.add(new ArrayList<EditText>());
+        experimentDescriptionsArray.add(new ArrayList<EditText>());
+        experimentInstructionsArray.add(new ArrayList<EditText>());
 
-        experimentInfoLayout.addView(experimentGroupLayout);
+        addExperimentToGroupButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                LinearLayout parent = (LinearLayout) v.getParent();
+                parent.removeView(v);
+                linearGroupLayout.addView(addExperimentFunction(localGroupIndex));
+                parent.addView(v);
+            }
+        });
 
         deleteGroupButton.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -389,7 +369,7 @@ public class NewBox extends AppCompatActivity {
                         .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                             @Override
                             public void onClick(DialogInterface dialog, int which) {
-                                experimentGroupLayout.removeAllViews();
+                                linearGroupLayout.removeAllViews();
                                 groupTitlesArray.remove(titleEditText);
                                 experimentTitlesArray.remove(localGroupIndex);
                                 experimentDescriptionsArray.remove(localGroupIndex);
@@ -401,116 +381,129 @@ public class NewBox extends AppCompatActivity {
             }
         });
 
-        globalGroupIndex++;
+        linearGroupLayout.addView(relativeGroupLayout);
+        linearGroupLayout.addView(addExperimentToGroupButton);
+        linearGroupLayout.addView(ProjectMacros.newHR(this, 4, "#888888"));
+
+        return linearGroupLayout;
     }
 
-    // Add experiment button function
-    private void addExperimentFunction(View v, final int localGroupIndex) {
-        ViewGroup addExperimentToGroupButtonParent = (ViewGroup) v.getParent();
-        addExperimentToGroupButtonParent.removeView(v);
-
-        /*
-         * LL Vert Overall
-         *   Linear Layout (horizontal)
-         *       LL (vert1)  LL (Vert2)
-         *       TitleView   TitleEdit
-         *       DescView    DescEdit
-         *       InstuctView InstructEdit
-         *   Title Data
-         *   LL (Hor)
-         *       LL (vert1)  LL (vert2)
-         *       SurveyView  SuveryButton
-         *   Delete Button
-         * */
-
-        final LinearLayout experimentDataLayout = new LinearLayout(NewBox.this);
-        experimentDataLayout.setOrientation(LinearLayout.VERTICAL);
-        experimentDataLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
-
-        //d("newGroup", String.valueOf(gI));
-
-        LinearLayout experimentSettingsLayout = new LinearLayout(NewBox.this);
-        experimentSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
-        experimentSettingsLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
-
-        LinearLayout experimentSettingsTextViewLayout = new LinearLayout(NewBox.this);
-        experimentSettingsTextViewLayout.setOrientation(LinearLayout.VERTICAL);
-        experimentSettingsTextViewLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1));
+    private RelativeLayout addExperimentFunction(final int localGroupIndex) {
+        final RelativeLayout experimentRelativeLayout = new RelativeLayout(this);
+
+        TextView experimentNumberLabel = new TextView(this);
+        String textViewTempText = "Experiment "+(experimentTitlesArray.size()+1)+":";
+        experimentNumberLabel.setText(textViewTempText);
+        experimentNumberLabel.setId(uniqueId++);
 
         TextView experimentTitleTextView = new TextView(NewBox.this);
-        experimentTitleTextView.setText("Title:");
+        textViewTempText = "Title:";
+        experimentTitleTextView.setText(textViewTempText);
+        experimentTitleTextView.setId(uniqueId++);
 
         TextView experimentDescriptionTextView = new TextView(NewBox.this);
-        experimentDescriptionTextView.setText("Description:");
+        textViewTempText = "Description:";
+        experimentDescriptionTextView.setText(textViewTempText);
+        experimentDescriptionTextView.setId(uniqueId++);
 
         TextView experimentInstructionsTextView = new TextView(NewBox.this);
-        experimentInstructionsTextView.setText("Instructions:");
-
-        experimentSettingsTextViewLayout.addView(experimentTitleTextView);
-        experimentSettingsTextViewLayout.addView(experimentDescriptionTextView);
-        experimentSettingsTextViewLayout.addView(experimentInstructionsTextView);
-
+        textViewTempText = "Instructions:";
+        experimentInstructionsTextView.setText(textViewTempText);
+        experimentInstructionsTextView.setId(uniqueId++);
 
-        LinearLayout experimentSettingsEditTextLayout = new LinearLayout(NewBox.this);
-        experimentSettingsEditTextLayout.setOrientation(LinearLayout.VERTICAL);
-        experimentSettingsEditTextLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, 1));
-
-        EditText experimentTitleEditText = new EditText(NewBox.this);
-        experimentTitleEditText.setHint("Title");
+        final EditText experimentTitleEditText = new EditText(NewBox.this);
+        textViewTempText = "Title";
+        experimentTitleEditText.setHint(textViewTempText);
         experimentTitleEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
-
-        experimentTitlesArray.add(new ArrayList<EditText>());
+        experimentTitleEditText.setId(uniqueId++);
         experimentTitlesArray.get(localGroupIndex).add(experimentTitleEditText);
 
-        EditText experimentDescriptionEditText = new EditText(NewBox.this);
-        experimentDescriptionEditText.setHint("Description");
+        final EditText experimentDescriptionEditText = new EditText(NewBox.this);
+        textViewTempText = "Description";
+        experimentDescriptionEditText.setHint(textViewTempText);
         experimentDescriptionEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
-
-        experimentDescriptionsArray.add(new ArrayList<EditText>());
+        experimentDescriptionEditText.setId(uniqueId++);
         experimentDescriptionsArray.get(localGroupIndex).add(experimentDescriptionEditText);
 
-        EditText experimentInstructionsEditText = new EditText(NewBox.this);
-        experimentInstructionsEditText.setHint("Instructions");
+        final EditText experimentInstructionsEditText = new EditText(NewBox.this);
+        textViewTempText = "Instructions";
+        experimentInstructionsEditText.setHint(textViewTempText);
         experimentInstructionsEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
-
-        experimentInstructionsArray.add(new ArrayList<EditText>());
+        experimentInstructionsEditText.setId(uniqueId++);
         experimentInstructionsArray.get(localGroupIndex).add(experimentInstructionsEditText);
 
-        experimentSettingsEditTextLayout.addView(experimentTitleEditText);
-        experimentSettingsEditTextLayout.addView(experimentDescriptionEditText);
-        experimentSettingsEditTextLayout.addView(experimentInstructionsEditText);
+        RelativeLayout.LayoutParams experimentNumberLabelAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentNumberLabelAlignment.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
+        experimentNumberLabelAlignment.addRule(RelativeLayout.ALIGN_PARENT_TOP);
+
+        @SuppressWarnings("deprecation") RelativeLayout.LayoutParams experimentTitleEditTextAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentTitleEditTextAlignment.addRule(RelativeLayout.BELOW, experimentNumberLabel.getId());
+        experimentTitleEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, experimentTitleTextView.getId());
+
+        RelativeLayout.LayoutParams experimentTitleTextViewAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentTitleTextViewAlignment.addRule(RelativeLayout.BELOW, experimentNumberLabel.getId());
+
+        @SuppressWarnings("deprecation") RelativeLayout.LayoutParams experimentDescriptionEditTextAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentDescriptionEditTextAlignment.addRule(RelativeLayout.BELOW, experimentTitleEditText.getId());
+        experimentDescriptionEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, experimentDescriptionTextView.getId());
+
+        RelativeLayout.LayoutParams experimentDescriptionTextViewAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentDescriptionTextViewAlignment.addRule(RelativeLayout.BELOW, experimentTitleEditText.getId());
+
+        @SuppressWarnings("deprecation") RelativeLayout.LayoutParams experimentInstructionsEditTextAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentInstructionsEditTextAlignment.addRule(RelativeLayout.BELOW, experimentDescriptionEditText.getId());
+        experimentInstructionsEditTextAlignment.addRule(RelativeLayout.RIGHT_OF, experimentInstructionsTextView.getId());
+
+        RelativeLayout.LayoutParams experimentInstructionsTextViewAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        experimentInstructionsTextViewAlignment.addRule(RelativeLayout.BELOW, experimentDescriptionEditText.getId());
+
+        RelativeLayout.LayoutParams localHRAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 2);
+        localHRAlignment.addRule(RelativeLayout.BELOW, experimentInstructionsEditText.getId());
+
+        experimentRelativeLayout.addView(experimentNumberLabel, experimentNumberLabelAlignment);
+        experimentRelativeLayout.addView(experimentTitleEditText, experimentTitleEditTextAlignment);
+        experimentRelativeLayout.addView(experimentTitleTextView, experimentTitleTextViewAlignment);
+        experimentRelativeLayout.addView(experimentDescriptionEditText, experimentDescriptionEditTextAlignment);
+        experimentRelativeLayout.addView(experimentDescriptionTextView, experimentDescriptionTextViewAlignment);
+        experimentRelativeLayout.addView(experimentInstructionsEditText, experimentInstructionsEditTextAlignment);
+        experimentRelativeLayout.addView(experimentInstructionsTextView, experimentInstructionsTextViewAlignment);
+        experimentRelativeLayout.addView(ProjectMacros.newHR(this, 2, "#666666"), localHRAlignment);
 
         Button deleteExperimentButton = new Button(NewBox.this);
-        deleteExperimentButton.setText("Delete Experiment");
+        textViewTempText = "x";
+        deleteExperimentButton.setText(textViewTempText);
         deleteExperimentButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 ViewGroup deleteExperimentButtonParent = (ViewGroup) v.getParent();
-                experimentDataLayout.removeAllViews();
+                experimentTitlesArray.get(localGroupIndex).remove(experimentTitleEditText);
+                experimentDescriptionsArray.get(localGroupIndex).remove(experimentDescriptionEditText);
+                experimentInstructionsArray.get(localGroupIndex).remove(experimentInstructionsEditText);
+                experimentRelativeLayout.removeAllViews();
                 deleteExperimentButtonParent.removeView(v);
             }
         });
 
         final Button addAnotherExperimentButton = new Button(NewBox.this);
-        addAnotherExperimentButton.setText("Add Experiment");
+        textViewTempText = "Add Experiment";
+        addAnotherExperimentButton.setText(textViewTempText);
         addAnotherExperimentButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                addExperimentFunction(v, localGroupIndex);
+                addExperimentFunction(localGroupIndex);
             }
         });
 
+        RelativeLayout.LayoutParams deleteExperimentButtonAlignment = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        deleteExperimentButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+        deleteExperimentButtonAlignment.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
 
-        experimentSettingsLayout.addView(experimentSettingsTextViewLayout);
-        experimentSettingsLayout.addView(experimentSettingsEditTextLayout);
-        experimentDataLayout.addView(experimentSettingsLayout);
+        experimentRelativeLayout.addView(deleteExperimentButton, deleteExperimentButtonAlignment);
 
-        addExperimentToGroupButtonParent.addView(experimentDataLayout);
-        addExperimentToGroupButtonParent.addView(deleteExperimentButton);
-        addExperimentToGroupButtonParent.addView(addAnotherExperimentButton);
+        return experimentRelativeLayout;
     }
 
-    // Image processing on result
+    // TODO: use this for the image upload on the other page, then its simply a case of trying to manage image processing
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
@@ -532,14 +525,13 @@ public class NewBox extends AppCompatActivity {
         }
     }
 
-    // Permission processing
     @Override
     public void onRequestPermissionsResult(int requestCode,
                                            @NonNull String[] permissions, @NonNull int[] grantResults) {
         if (requestCode == 1) {// If request is cancelled, the result arrays are empty.
             if (grantResults.length > 0
                     && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
-                d("Perm", "granted");
+                d("dbg_Perm", "granted");
                 startImageUpload();
             } else {
                 AlertDialog.Builder builder = new AlertDialog.Builder(NewBox.this);
@@ -558,8 +550,7 @@ public class NewBox extends AppCompatActivity {
         }
     }
 
-    // Start image upload
-    public void startImageUpload() {
+    private void startImageUpload() {
         CropImage.activity()
                 .setMinCropResultSize(100, 100)
                 .setGuidelines(CropImageView.Guidelines.OFF)
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/ProgressActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/ProgressActivity.java
index 040aa45..43c7729 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/ProgressActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/ProgressActivity.java
@@ -1,19 +1,21 @@
 package com.yearthreeproject.xbframework;
 
+import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.Button;
 import android.widget.TextView;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 
-public class ProgressActivity extends AppCompatActivity {
+import java.util.Objects;
 
-    private Toolbar toolbar;
-    private Button backHomeButton;
+public class ProgressActivity extends AppCompatActivity {
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -22,16 +24,16 @@ public class ProgressActivity extends AppCompatActivity {
 
         // TODO: implement any of this page / class
 
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
         TextView onlyTextView = findViewById(R.id.ProgressPlaceholderTextView);
         onlyTextView.setText(FileStoreReader.readFile(ProgressActivity.this, "localUserData.json"));
 
-        backHomeButton = findViewById(R.id.ProgressBackHomButton);
+        Button backHomeButton = findViewById(R.id.ProgressBackHomButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/ProjectMacros.java b/app/src/main/java/com/yearthreeproject/xbframework/ProjectMacros.java
new file mode 100644
index 0000000..0eb879b
--- /dev/null
+++ b/app/src/main/java/com/yearthreeproject/xbframework/ProjectMacros.java
@@ -0,0 +1,16 @@
+package com.yearthreeproject.xbframework;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.view.View;
+import android.view.ViewGroup;
+
+class ProjectMacros {
+    static View newHR(Context context, int thickness, String colour) {
+        View hrTemp = new View(context);
+        ViewGroup.LayoutParams hrLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, thickness);
+        hrTemp.setLayoutParams(hrLayoutParams);
+        hrTemp.setBackgroundColor(Color.parseColor(colour));
+        return hrTemp;
+    }
+}
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/ShopActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/ShopActivity.java
index fbac9f4..0445469 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/ShopActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/ShopActivity.java
@@ -2,18 +2,13 @@ package com.yearthreeproject.xbframework;
 
 import android.annotation.SuppressLint;
 import android.graphics.Color;
-import android.media.Image;
 import android.os.Build;
 import android.os.Bundle;
 import android.view.Gravity;
 import android.view.View;
-import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.GridLayout;
-import android.widget.GridLayout.Alignment;
-import android.widget.GridView;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -24,8 +19,6 @@ import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.cardview.widget.CardView;
 
-import com.google.android.material.snackbar.Snackbar;
-
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -33,14 +26,16 @@ import org.json.JSONObject;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Objects;
 
 import static android.util.Log.d;
-import static android.widget.GridLayout.*;
+import static android.widget.GridLayout.ALIGN_BOUNDS;
+import static android.widget.GridLayout.ALIGN_MARGINS;
+import static android.widget.GridLayout.OnClickListener;
+import static android.widget.GridLayout.UNDEFINED;
 
 public class ShopActivity extends AppCompatActivity {
 
-    private Toolbar toolbar;
-    private Button backHomeButton;
     private Toast attemptToBuyPopup;
 
     @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@@ -51,10 +46,11 @@ public class ShopActivity extends AppCompatActivity {
         setContentView(R.layout.activity_shop);
 
         // TODO: implement more ideas into the data array, but have the functionality on click to express that you cannot buy at the moment
+        // TODO: remove the dependency on the card-view and make the view yourself with relative layouts
 
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
@@ -87,7 +83,7 @@ public class ShopActivity extends AppCompatActivity {
             for (int i = 0; i < shopItemsJSONArray.length(); i++) {
                 JSONObject shopItem = shopItemsJSONArray.getJSONObject(i);
 
-                d("shopitems", shopItem.toString());
+                d("dbg_shopItems", shopItem.toString());
 
                 CardView shopItemCard = new CardView(ShopActivity.this);
 
@@ -122,7 +118,8 @@ public class ShopActivity extends AppCompatActivity {
 
                 TextView itemPrice = new TextView(ShopActivity.this);
                 itemPrice.setId(uniqueId++);
-                itemPrice.setText(Double.toString(shopItem.getDouble("Price")));
+                String textViewTempText = Double.toString(shopItem.getDouble("Price"));
+                itemPrice.setText(textViewTempText);
                 itemPrice.setBackgroundColor(Color.parseColor("#FFFFFF"));
 
                 RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
@@ -137,7 +134,7 @@ public class ShopActivity extends AppCompatActivity {
                 RelativeLayout.LayoutParams priceParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
                 priceParams.addRule(RelativeLayout.ALIGN_BOTTOM, itemImage.getId());
                 priceParams.addRule(RelativeLayout.ALIGN_RIGHT, itemImage.getId());
-                itemPrice.setGravity(Gravity.RIGHT);
+                itemPrice.setGravity(Gravity.END);
 
                 RelativeLayout.LayoutParams descParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
                 descParams.addRule(RelativeLayout.BELOW, itemTitle.getId());
@@ -154,10 +151,8 @@ public class ShopActivity extends AppCompatActivity {
                     public void onClick(View view) {
                         // Essentially if else, but because it causes a fatal error is try catch
                         try {
-                            d("attempt", String.valueOf(attemptToBuyPopup.getView().isShown()));
-                            if(attemptToBuyPopup.getView().isShown()){
-                                // Do nothing
-                            }else {
+                            d("dbg_attempt", String.valueOf(attemptToBuyPopup.getView().isShown()));
+                            if(!attemptToBuyPopup.getView().isShown()){
                                 attemptToBuyPopup.show();
                             }
                         } catch (Exception e){
@@ -177,7 +172,7 @@ public class ShopActivity extends AppCompatActivity {
         }
 
 
-        backHomeButton = findViewById(R.id.ShopBackHomeButton);
+        Button backHomeButton = findViewById(R.id.ShopBackHomeButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
diff --git a/app/src/main/java/com/yearthreeproject/xbframework/TestingActivity.java b/app/src/main/java/com/yearthreeproject/xbframework/TestingActivity.java
index ae181c7..8b77f1c 100644
--- a/app/src/main/java/com/yearthreeproject/xbframework/TestingActivity.java
+++ b/app/src/main/java/com/yearthreeproject/xbframework/TestingActivity.java
@@ -5,12 +5,14 @@ import android.app.Notification;
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
+import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.core.app.NotificationCompat;
@@ -20,19 +22,19 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.Calendar;
+import java.util.Objects;
 
 public class TestingActivity extends AppCompatActivity {
-    private Toolbar toolbar;
-    private Button backHomeButton;
 
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         setContentView(R.layout.activity_testing);
-        toolbar = findViewById(R.id.toolbar);
+        Toolbar toolbar = findViewById(R.id.toolbar);
         setSupportActionBar(toolbar);
-        getSupportActionBar().setDisplayShowHomeEnabled(true);
+        Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true);
         getSupportActionBar().setLogo(R.mipmap.ic_launcher);
         getSupportActionBar().setDisplayUseLogoEnabled(true);
 
@@ -47,7 +49,7 @@ public class TestingActivity extends AppCompatActivity {
             }
         });
 
-        backHomeButton = findViewById(R.id.TestingBackHomButton);
+        Button backHomeButton = findViewById(R.id.TestingBackHomButton);
         backHomeButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 finish();
@@ -84,7 +86,7 @@ public class TestingActivity extends AppCompatActivity {
             box = new JSONObject();
             box.put("Name", "SleepBoxV2");
             box.put("Group", "Sleep");
-            box.put("Blurb", "A less featurefull SleepBox");
+            box.put("Blurb", "A less feature-full SleepBox");
             box.put("Locked", false);
             box.put("Image", JSONObject.NULL);
             box.put("Description", "Does not do anything close to SleepBox, just is my method of testing!");
@@ -98,7 +100,7 @@ public class TestingActivity extends AppCompatActivity {
 
             experiment.put("Title", "Sunlight");
             experiment.put("Instructions", "Get 30 to 45 minutes of sunlight a day. Make sure your room captures sunlight.");
-            experiment.put("Description", "This will boost circadium rhythm.");
+            experiment.put("Description", "This will boost circadian rhythm.");
 
             groupExperimentList.put(experiment);
             experimentGroupInfo.put("Options", groupExperimentList);
@@ -131,7 +133,7 @@ public class TestingActivity extends AppCompatActivity {
         assert alarmManager != null;
 
         if(intendedTime >= currentTime){
-            Log.d("time", "intende time is today");
+            Log.d("dbg_time", "intended time is today");
             // you can add buffer time too here to ignore some small differences in milliseconds
             // set from today
             alarmManager.setRepeating(AlarmManager.RTC, intendedTime, AlarmManager.INTERVAL_DAY, pendingIntent);
diff --git a/app/src/main/res/drawable/notification_icon.xml b/app/src/main/res/drawable/notification_icon.xml
deleted file mode 100644
index a8b409b..0000000
--- a/app/src/main/res/drawable/notification_icon.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
-</selector>
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/content_about.xml
index b4758f7..dea7126 100644
--- a/app/src/main/res/layout/content_about.xml
+++ b/app/src/main/res/layout/content_about.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/AboutActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -14,19 +13,16 @@
 
 
     <ScrollView
-        android:id="@+id/AboutScrollView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1">
 
         <LinearLayout
-            android:id="@+id/AboutScrollParagraphLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
 
             <TextView
-                android:id="@+id/AboutParagraphTextView"
                 android:layout_width="match_parent"
                 android:layout_height="0dp"
                 android:layout_weight="1"
diff --git a/app/src/main/res/layout/content_boxes.xml b/app/src/main/res/layout/content_boxes.xml
index f48e69c..4bba114 100644
--- a/app/src/main/res/layout/content_boxes.xml
+++ b/app/src/main/res/layout/content_boxes.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/BoxesActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,7 +12,6 @@
     tools:showIn="@layout/activity_boxes">
 
     <ScrollView
-        android:id="@+id/BoxesActivityScrollView"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1">
diff --git a/app/src/main/res/layout/content_experiment.xml b/app/src/main/res/layout/content_experiment.xml
index b97fcc6..76e3f14 100644
--- a/app/src/main/res/layout/content_experiment.xml
+++ b/app/src/main/res/layout/content_experiment.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/ExperimentActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,7 +12,6 @@
     tools:showIn="@layout/activity_experiment">
 
     <ScrollView
-        android:id="@+id/ExperimentScrollView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1">
@@ -22,29 +20,31 @@
             android:id="@+id/ExperimentInfoLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical"></LinearLayout>
+            android:orientation="vertical" />
 
     </ScrollView>
 
     <LinearLayout
-        android:id="@+id/ExperimentNavigationLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="0"
-        android:orientation="horizontal">
+        android:orientation="horizontal" >
 
         <Button
             android:id="@+id/ExperimentBackHomeButton"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
-            android:text="@string/about_back_home_button" />
+            style="?android:attr/buttonBarButtonStyle"
+            android:text="@string/about_back_home_button"
+            tools:ignore="NestedWeights" />
 
         <Button
             android:id="@+id/ExperimentSubmitButton"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
+            style="?android:attr/buttonBarButtonStyle"
             android:text="@string/experiment_submit" />
 
     </LinearLayout>
diff --git a/app/src/main/res/layout/content_experiment_survey_creator.xml b/app/src/main/res/layout/content_experiment_survey_creator.xml
index 63c597c..98f77ce 100644
--- a/app/src/main/res/layout/content_experiment_survey_creator.xml
+++ b/app/src/main/res/layout/content_experiment_survey_creator.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/ExperimentSurveyActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,7 +12,6 @@
     tools:showIn="@layout/activity_experiment_survey_creator">
 
     <ScrollView
-        android:id="@+id/SurveyScroll"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1">
@@ -22,12 +20,11 @@
             android:id="@+id/SurveyCreationLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical"></LinearLayout>
+            android:orientation="vertical" />
 
     </ScrollView>
 
     <LinearLayout
-        android:id="@+id/ExperimentSurveyNavigationLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="0"
@@ -38,13 +35,16 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
-            android:text="@string/about_back_home_button" />
+            style="?android:attr/buttonBarButtonStyle"
+            android:text="@string/about_back_home_button"
+            tools:ignore="NestedWeights" />
 
         <Button
             android:id="@+id/ExperimentSurveyCreatorSubmitButton"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
+            style="?android:attr/buttonBarButtonStyle"
             android:text="@string/next" />
 
     </LinearLayout>
diff --git a/app/src/main/res/layout/content_login.xml b/app/src/main/res/layout/content_login.xml
index 93e1e32..55dd5eb 100644
--- a/app/src/main/res/layout/content_login.xml
+++ b/app/src/main/res/layout/content_login.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/LoginActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -14,57 +13,52 @@
 
 
     <LinearLayout
-        android:id="@+id/LoginFieldLayout"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:layout_weight="1"
         android:orientation="vertical">
 
         <LinearLayout
-            android:id="@+id/EmailLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal">
 
             <TextView
-                android:id="@+id/EmailTextView"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
                 android:text="@string/login_email" />
 
             <EditText
-                android:id="@+id/EmailEditText"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
                 android:ems="10"
                 android:hint="@string/login_email_hint"
-                android:inputType="textEmailAddress" />
+                android:inputType="textEmailAddress"
+                tools:ignore="Autofill" />
 
         </LinearLayout>
 
         <LinearLayout
-            android:id="@+id/PasswordLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal">
 
             <TextView
-                android:id="@+id/PasswordTextView"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
                 android:text="@string/login_password" />
 
             <EditText
-                android:id="@+id/PasswordEditText"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
                 android:ems="10"
                 android:hint="@string/login_password_hint"
-                android:inputType="textPassword" />
+                android:inputType="textPassword"
+                tools:ignore="Autofill"/>
 
         </LinearLayout>
 
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index 078c9ca..0e9d2e7 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -31,7 +31,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1"
-        android:text="Survey" />
+        android:text="@string/HomeSurvey" />
 
     <Button
         android:id="@+id/HomeShopButton"
diff --git a/app/src/main/res/layout/content_new_box.xml b/app/src/main/res/layout/content_new_box.xml
index 5c12eb7..c151ea6 100644
--- a/app/src/main/res/layout/content_new_box.xml
+++ b/app/src/main/res/layout/content_new_box.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/NewBoxActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,22 +12,19 @@
     tools:showIn="@layout/activity_new_box">
 
     <TextView
-        android:id="@+id/CreateBoxTextView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:text="Create a new Box"
+        android:text="@string/NewBoxCreateTitle"
         android:textSize="36sp"
         android:textStyle="bold"
         android:typeface="sans" />
 
     <View
-        android:id="@+id/hr1"
         android:layout_width="match_parent"
         android:layout_height="2dp"
         android:background="#000000" />
 
     <ScrollView
-        android:id="@+id/DataInputScrollView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1">
@@ -40,69 +36,60 @@
             android:orientation="vertical">
 
             <LinearLayout
-                android:id="@+id/BoxInfoLayout"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:orientation="horizontal">
 
                 <LinearLayout
-                    android:id="@+id/BoxDataTextViewLayout"
                     android:layout_width="wrap_content"
                     android:layout_height="match_parent"
                     android:orientation="vertical">
 
                     <TextView
-                        android:id="@+id/TitleTextView"
                         android:layout_width="wrap_content"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="Title:" />
+                        android:text="@string/NewBoxTitleLabel" />
 
                     <TextView
-                        android:id="@+id/textView"
                         android:layout_width="wrap_content"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="Blurb:" />
+                        android:text="@string/NewBoxBlurbLabel" />
 
                     <TextView
-                        android:id="@+id/DescriptionTextView"
                         android:layout_width="wrap_content"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="Description:" />
+                        android:text="@string/NewBoxDescriptionLabel" />
 
                     <TextView
-                        android:id="@+id/WarningTextView"
                         android:layout_width="match_parent"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="Warning:" />
+                        android:text="@string/NewBoxWarningLabel" />
 
                     <TextView
-                        android:id="@+id/ImageTextView"
                         android:layout_width="match_parent"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="Image:" />
+                        android:text="@string/NewBoxImageLabel" />
 
                     <TextView
-                        android:id="@+id/MEECSTextView"
                         android:layout_width="match_parent"
                         android:layout_height="0dp"
                         android:layout_weight="1"
                         android:gravity="center_vertical"
-                        android:text="MEECS:" />
+                        android:text="@string/NewBoxSpinnerLabel" />
 
                 </LinearLayout>
 
                 <LinearLayout
-                    android:id="@+id/BoxDataInputLayout"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:orientation="vertical">
@@ -113,9 +100,10 @@
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
                         android:ems="10"
-                        android:hint="Box Title"
+                        android:hint="@string/NewBoxBoxTitleHint"
                         android:inputType="textPersonName"
-                        android:text="Title" />
+                        android:text="@string/GenericTitleEditText"
+                        tools:ignore="Autofill" />
 
                     <EditText
                         android:id="@+id/BlurbEditText"
@@ -123,9 +111,10 @@
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
                         android:ems="10"
-                        android:hint="Very short description "
+                        android:hint="@string/NewBoxBlurbHint"
                         android:inputType="textPersonName"
-                        android:text="Description" />
+                        android:text="@string/GenericEditTextDescription"
+                        tools:ignore="Autofill" />
 
                     <EditText
                         android:id="@+id/DescriptionEditText"
@@ -133,9 +122,10 @@
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
                         android:ems="10"
-                        android:hint="Description"
+                        android:hint="@string/GenericEditTextDescription"
                         android:inputType="textPersonName"
-                        android:text="Longer Description" />
+                        android:text="@string/NewBoxEditTextLongerDescription"
+                        tools:ignore="Autofill" />
 
                     <EditText
                         android:id="@+id/WarningEditText"
@@ -143,16 +133,18 @@
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
                         android:ems="10"
-                        android:hint="Warning"
+                        android:hint="@string/NewBoxEditTextWarningHint"
                         android:inputType="textPersonName"
-                        android:text="Warning Text" />
+                        android:text="@string/NewBoxWarningEditText"
+                        tools:ignore="Autofill" />
 
                     <ImageView
                         android:id="@+id/UploadImageButton"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_weight="1"
-                        app:srcCompat="@mipmap/ic_launcher" />
+                        app:srcCompat="@mipmap/ic_launcher"
+                        android:contentDescription="@string/NewBoxImageUpload" />
 
                     <Spinner
                         android:id="@+id/MEECSSpinner"
@@ -165,107 +157,23 @@
             </LinearLayout>
 
             <View
-                android:id="@+id/hr2"
                 android:layout_width="match_parent"
                 android:layout_height="2dp"
                 android:layout_weight="1"
-                android:background="#000000" />
+                android:background="#000000"
+                tools:ignore="InefficientWeight" />
 
-            <LinearLayout
-                android:id="@+id/ExperimentsInfoLayout"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
-
-                <LinearLayout
-                    android:id="@+id/GroupOneLayout"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:orientation="vertical">
-
-                    <TextView
-                        android:id="@+id/CreateExperimentTextView"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:text="Experiments in the Box"
-                        android:textSize="36sp"
-                        android:textStyle="bold"
-                        android:typeface="sans" />
-
-                    <LinearLayout
-                        android:id="@+id/GroupOneSettingsLayout"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:orientation="horizontal">
-
-                        <LinearLayout
-                            android:id="@+id/GroupOneDataTextViewLayout"
-                            android:layout_width="wrap_content"
-                            android:layout_height="match_parent"
-                            android:orientation="vertical">
-
-                            <TextView
-                                android:id="@+id/GroupOneTitleTextView"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:gravity="center_vertical"
-                                android:text="Title:" />
-
-                            <TextView
-                                android:id="@+id/GroupOneExperimentsTextView"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:gravity="center_vertical"
-                                android:text="Experiments:" />
-
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:id="@+id/GroupOneDataInputLayout"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:orientation="vertical">
-
-                            <EditText
-                                android:id="@+id/GroupOneTitleEditText"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:ems="10"
-                                android:hint="Group Title"
-                                android:inputType="textPersonName"
-                                android:text="Group One Title" />
-
-                            <Button
-                                android:id="@+id/GroupOneAddExperimentButton"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:text="Add Experiment" />
-
-                        </LinearLayout>
-                    </LinearLayout>
-                </LinearLayout>
-
-                <View
-                    android:id="@+id/hr3"
-                    android:layout_width="match_parent"
-                    android:layout_height="2dp"
-                    android:layout_weight="1"
-                    android:background="#000000" />
-            </LinearLayout>
-
-            <Button
-                android:id="@+id/AddExperimentGroupButton"
+            <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="Add Another Group" />
+                android:text="@string/ExperimentsInTheBoxLabel"
+                android:textSize="36sp"
+                android:textStyle="bold" />
 
         </LinearLayout>
     </ScrollView>
 
     <LinearLayout
-        android:id="@+id/NewBoxNavigationLayout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="0"
@@ -276,13 +184,16 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:text="Back" />
+            style="?android:attr/buttonBarButtonStyle"
+            android:text="@string/NewBoxBackButton"
+            tools:ignore="NestedWeights" />
 
         <Button
             android:id="@+id/NewBoxSubmitButton"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="1"
-            android:text="Submit" />
+            style="?android:attr/buttonBarButtonStyle"
+            android:text="@string/NewBoxSubmitButton" />
     </LinearLayout>
 </LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_progress.xml b/app/src/main/res/layout/content_progress.xml
index e2d7b80..d9bd5ef 100644
--- a/app/src/main/res/layout/content_progress.xml
+++ b/app/src/main/res/layout/content_progress.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/ProgressActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,13 +12,11 @@
     tools:showIn="@layout/activity_progress">
 
     <ScrollView
-        android:id="@+id/ProgressScrollView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1">
 
         <LinearLayout
-            android:id="@+id/ContentContainerLayout"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
@@ -27,8 +24,7 @@
             <TextView
                 android:id="@+id/ProgressPlaceholderTextView"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:text="TextView" />
+                android:layout_height="wrap_content" />
         </LinearLayout>
     </ScrollView>
 
diff --git a/app/src/main/res/layout/content_shop.xml b/app/src/main/res/layout/content_shop.xml
index c62f57e..79956c4 100644
--- a/app/src/main/res/layout/content_shop.xml
+++ b/app/src/main/res/layout/content_shop.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/ShopActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,7 +12,6 @@
     tools:showIn="@layout/activity_shop">
 
     <ScrollView
-        android:id="@+id/ShopScrollView"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1">
@@ -23,7 +21,6 @@
             android:layout_width="378dp"
             android:layout_height="0dp"
             android:columnCount="2"
-            android:layout_weight="8"
             android:rowCount="5"
             android:padding="14sp"
             />
diff --git a/app/src/main/res/layout/content_testing.xml b/app/src/main/res/layout/content_testing.xml
index 7ef0954..e71cfdb 100644
--- a/app/src/main/res/layout/content_testing.xml
+++ b/app/src/main/res/layout/content_testing.xml
@@ -2,7 +2,6 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/ProgressActivityLayout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_margin="16dp"
@@ -13,13 +12,11 @@
     tools:showIn="@layout/activity_testing">
 
     <ScrollView
-        android:id="@+id/TestingScrollView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1">
 
         <LinearLayout
-            android:id="@+id/ContentContainerLayoutTesting"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
@@ -28,7 +25,8 @@
                 android:id="@+id/testingRunButton"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:text="Run" />
+                android:text="Run"
+                tools:ignore="HardcodedText" />
         </LinearLayout>
     </ScrollView>
 
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
deleted file mode 100644
index 2934487..0000000
--- a/app/src/main/res/menu/menu_main.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    tools:context="com.yearthreeproject.experinbox.MainActivity">
-    <item
-        android:id="@+id/action_settings"
-        android:orderInCategory="100"
-        android:title="@string/action_settings"
-        app:showAsAction="never" />
-</menu>
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 23b9428..eb759e7 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string-array name="meecs" >
-        <item>Select a MEECS...</item>
+        <item>Select a MEECS…</item>
         <item>Move</item>
         <item>Eat</item>
         <item>Engage</item>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 6723679..dcff6cd 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -3,5 +3,4 @@
     <color name="colorPrimary">#587B7F</color>
     <color name="colorPrimaryDark">#393E41</color>
     <color name="colorAccent">#000000</color>
-    <color name="colorSecondary">#D3D0CB</color>
 </resources>
diff --git a/app/src/main/res/values/idValues.xml b/app/src/main/res/values/idValues.xml
index 31f40c4..0d2c4cc 100644
--- a/app/src/main/res/values/idValues.xml
+++ b/app/src/main/res/values/idValues.xml
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <item type='id' name="newExperimentGroup1Name"/>
 
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 978d136..a0b7f74 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,9 +1,8 @@
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
     <!-- General Strings -->
     <string name="app_name">XBFramework</string>
 
     <!-- Overall Layout Strings -->
-    <string name="action_settings">Settings</string>
 
     <!-- Main Page Strings -->
     <string name="main_home">Home</string>
@@ -22,18 +21,35 @@
 
 
     <!-- About Page Strings -->
-    <string name="about_about_para">Welcome to ExperInBox, an app dedicated to helping you make the most of your self improvement and benefiting researchers at the same time!
+    <string name="about_about_para" tools:ignore="Typos">Welcome to ExperInBox, an app dedicated to helping you make the most of your self improvement and benefiting researchers at the same time!
         \n\nThis app is being developed for a third year individual project at the University of Southampton by Eamonn Trim. The purpose is to tie together the worlds of cutting edge day to day health research with the users who would like to improve their standard of living.
-        \n\nIf there are any issues or any feedback, feel free to contact me at: ect1u17@soton.ac.uk. If not enjoy the app and I hope these experiments help improve your wellbeing!
+        \n\nIf there are any issues or any feedback, feel free to contact me at: ect1u17@soton.ac.uk. If not enjoy the app and I hope these experiments help improve your well-being!
     </string>
 
     <string name="about_back_home_button">Back to Home</string>
 
     <!-- Experiments Page Strings -->
-    <string name="experiments_placeholder">Example of a shop item name</string>
-    <string name="experiments_placeholder_image">Example of image description</string>
 
     <string name="experiment_submit">Submit</string>
     <string name="next">Next</string>
+    <string name="HomeSurvey">Survey</string>
+    <string name="NewBoxCreateTitle">Create a new Box</string>
+    <string name="NewBoxTitleLabel">Title:</string>
+    <string name="NewBoxBlurbLabel">Blurb:</string>
+    <string name="NewBoxDescriptionLabel">Description:</string>
+    <string name="GenericTitleEditText">Title</string>
+    <string name="GenericEditTextDescription">Description</string>
+    <string name="ExperimentsInTheBoxLabel">Experiments in the Box</string>
+    <string name="NewBoxBackButton">Back</string>
+    <string name="NewBoxSubmitButton">Submit</string>
+    <string name="NewBoxImageUpload">Upload an image button</string>
+    <string name="NewBoxWarningEditText">Warning Text</string>
+    <string name="NewBoxEditTextWarningHint">Warning</string>
+    <string name="NewBoxEditTextLongerDescription">Longer Description</string>
+    <string name="NewBoxBlurbHint">Very short description</string>
+    <string name="NewBoxBoxTitleHint">Box Title</string>
+    <string name="NewBoxSpinnerLabel">MEECS:</string>
+    <string name="NewBoxImageLabel">Image:</string>
+    <string name="NewBoxWarningLabel">Warning:</string>
 
 </resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 545b9c6..2c85a0c 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -15,6 +15,4 @@
 
     <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
 
-    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
-
 </resources>
-- 
GitLab