diff --git a/ActivityLifecycleWalkthrough.pdf b/ActivityLifecycleWalkthrough.pdf deleted file mode 100644 index caf06819035e5d1e566c9faeaa4dbbaacb94bc3e..0000000000000000000000000000000000000000 Binary files a/ActivityLifecycleWalkthrough.pdf and /dev/null differ diff --git a/Lab-Activity.pdf b/Lab-Activity.pdf deleted file mode 100644 index 09042afed8a167877aefcb114bc4f663578eb049..0000000000000000000000000000000000000000 Binary files a/Lab-Activity.pdf and /dev/null differ diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 8b7cbbc2c87fbbeac7e7d50891108a7d230ce8c3..0000000000000000000000000000000000000000 --- a/app/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 26 - buildToolsVersion "26.0.1" - - defaultConfig { - applicationId "course.labs.activitylab" - minSdkVersion 21 - targetSdkVersion 26 - - testApplicationId "course.labs.activitylab.tests" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } - } -} - -dependencies { - androidTestCompile 'com.android.support.test:rules:0.4.1' - androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.0' -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test1_StartActivityOneTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test1_StartActivityOneTest.java deleted file mode 100644 index e57382b4d2591ce1d3ac5063a64bf0172e3753a5..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test1_StartActivityOneTest.java +++ /dev/null @@ -1,55 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test1_StartActivityOneTest extends - ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test1_StartActivityOneTest() { - super(ActivityOne.class); - } - - public void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - // Execution of StartActivityOneTest - public void testRun() { - - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("StartActivityOneTest failed: " + "Section One:" - + "ActivityOne did not correctly load", solo.waitForActivity( - course.labs.activitylab.ActivityOne.class, timeout)); - - - // ==================== Section Two ===================== - // Check for proper counts - assertTrue("StartActivityOneTest failed:" + "Section Two:" - + "onCreate() count was off for ActivityOne", - solo.waitForText("onCreate\\(\\) calls: 1")); - assertTrue("StartActivityOneTest failed:" + "Section Two:" - + "onStart() count was off for ActivityOne", - solo.waitForText("onStart\\(\\) calls: 1")); - assertTrue("StartActivityOneTest failed:" + "Section Two:" - + "onResume() count was off for ActivityOne", - solo.waitForText("onResume\\(\\) calls: 1")); - assertTrue("StartActivityOneTest failed:" + "Section Two:" - + "onRestart() count was off for ActivityOne", - solo.waitForText("onRestart\\(\\) calls: 0")); - - } - -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test2_DoubleRotateActivityOneTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test2_DoubleRotateActivityOneTest.java deleted file mode 100644 index bfaecc8f3be0140057d98279f7d082ddf10c4c1e..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test2_DoubleRotateActivityOneTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test2_DoubleRotateActivityOneTest extends - ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test2_DoubleRotateActivityOneTest() { - super(ActivityOne.class); - } - - public void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - public void testRun() { - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("DoubleRotateActivityOneTest failed: " + - "Section One:" + - "ActivityOne did not correctly load", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - - int sleep = 1000; - solo.sleep(sleep); - - // ==================== Section Two ===================== - // Rotate the screen - solo.setActivityOrientation(Solo.LANDSCAPE); - - // Wait for activity: 'course.labs.activitylab.ActivityOne' - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Two:" + - "ActivityOne did not correctly load after first LANDSCAPE rotation.", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - - solo.sleep(sleep); - - // ==================== Section Three ===================== - // Rotate the screen - solo.setActivityOrientation(Solo.PORTRAIT); - - // Wait for activity: 'course.labs.activitylab.ActivityOne' - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Three:" + - "ActivityOne did not correctly load after second PORTRAIT rotation.", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - solo.sleep(sleep); - - // Check for proper counts - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Three:" + - "onCreate() count was off for ActivityOne after second PORTRAIT rotation.", - solo.searchText("onCreate\\(\\) calls: 3")); - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Three:" + - "onStart() count was off for ActivityOne after second PORTRAIT rotation.", - solo.searchText("onStart\\(\\) calls: 3")); - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Three:" + - "onResume() count was off for ActivityOne after second PORTRAIT rotation.", - solo.searchText("onResume\\(\\) calls: 3")); - assertTrue("DoubleRotateActivityOneTest failed:" + - "Section Three:" + - "onRestart() count was off for ActivityOne after second PORTRAIT rotation.", - solo.searchText("onRestart\\(\\) calls: 0")); - } - -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test3_StartActivityTwoTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test3_StartActivityTwoTest.java deleted file mode 100644 index a614ec9f95d7041ed3e11b504f68cf38cd3221e4..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test3_StartActivityTwoTest.java +++ /dev/null @@ -1,74 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test3_StartActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test3_StartActivityTwoTest() { - super(ActivityOne.class); - } - - protected void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - // Executes the StartActivityTwoTest - public void testRun() { - - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("StartActivityTwoTest failed:" + - "Section One:" + - "ActivityOne did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - - // ==================== Section Two ===================== - // Click on Start Activity Two - - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - solo.clickOnView(solo - .getView(course.labs.activitylab.R.id.bLaunchActivityTwo)); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("StartActivityTwoTest failed:" + - "Section Two:" + - "ActivityTwo did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - - // Check for proper counts after ActivityTwo has been opened - assertTrue("StartActivityTwoTest failed:" + - "Section Two:" + - "onCreate() count was off for ActivityTwo.", - solo.waitForText("onCreate\\(\\) calls: 1")); - - assertTrue("StartActivityTwoTest failed:" + - "Section Two:" + - "onStart() count was off for ActivityTwo.", - solo.waitForText("onStart\\(\\) calls: 1")); - - assertTrue("StartActivityTwoTest failed:" + - "Section Two:" + - "onResume() count was off for ActivityTwo.", - solo.waitForText("onResume\\(\\) calls: 1")); - - assertTrue("StartActivityTwoTest failed:" + - "Section Two:" + - "onRestart() count was off for ActivityTwo.", - solo.waitForText("onRestart\\(\\) calls: 0")); - } - -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test4_DoubleRotateActivityTwoTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test4_DoubleRotateActivityTwoTest.java deleted file mode 100644 index 186b6a36a4bdc963013d016b03c79af2ea8453eb..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test4_DoubleRotateActivityTwoTest.java +++ /dev/null @@ -1,98 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test4_DoubleRotateActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test4_DoubleRotateActivityTwoTest() { - super(ActivityOne.class); - } - - protected void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - // Executes the DoubleRotateActivityTwoTest - public void testRun() { - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section One:" + - "ActivityOne did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - - // ==================== Section Two ===================== - // Click on Start Activity Two - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - solo.clickOnView(solo - .getView(course.labs.activitylab.R.id.bLaunchActivityTwo)); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Two:" + - "ActivityTwo did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - // ==================== Section Three ===================== - // Rotate the screen - solo.setActivityOrientation(Solo.LANDSCAPE); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Three:" + - "ActivityTwo did not correctly load after first LANDSCAPE rotation.", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - // ==================== Section Four ===================== - // Rotate the screen - solo.setActivityOrientation(Solo.PORTRAIT); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Four:" + - "ActivityTwo did not correctly load after second PORTRAIT rotation.", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - // Check for proper counts - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Four:" + - "onCreate() count was off for ActivityTwo after second PORTRAIT rotation.", - solo.waitForText("onCreate\\(\\) calls: 3")); - - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Four:" + - "onStart() count was off for ActivityTwo after second PORTRAIT rotation.", - solo.waitForText("onStart\\(\\) calls: 3")); - - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Four:" + - "onResume() count was off for ActivityTwo after second PORTRAIT rotation.", - solo.waitForText("onResume\\(\\) calls: 3")); - - assertTrue("DoubleRotateActivityTwoTest failed:" + - "Section Four:" + - "onRestart() count was off for ActivityTwo after second PORTRAIT rotation.", - solo.waitForText("onRestart\\(\\) calls: 0")); - } - -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test5_CloseActivityTwoTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test5_CloseActivityTwoTest.java deleted file mode 100644 index 543e4c6414fbb121984e26aff8d5f8f06409598c..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test5_CloseActivityTwoTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test5_CloseActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test5_CloseActivityTwoTest() { - super(ActivityOne.class); - } - - protected void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - // Executes the CloseActivityTwoTest - public void testRun() { - - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("CloseActivityTwoTest failed:" + - "Section One:" + - "ActivityOne did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - - // ==================== Section Two ===================== - // Click on Start Activity Two - solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo)); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("CloseActivityTwoTest failed:" + - "Section Two:" + - "ActivityTwo did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - - // ==================== Section Three ===================== - // Click on Close Activity - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - int sleep = 1000; - solo.sleep(sleep); - - solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bClose)); - - - // Wait for activity: 'course.labs.activitylab.ActivityOne' - assertTrue("CloseActivityTwoTest failed:" + - "Section Three:" + - "ActivityTwo did not close correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - - // Check for proper counts - assertTrue("CloseActivityTwoTest failed:" + - "Section Three:" + - "onCreate() count was off for ActivityOne after ActivityTwo closed.", - solo.waitForText("onCreate\\(\\) calls: 1")); - - assertTrue("CloseActivityTwoTest failed:" + - "Section Three:" + - "onStart() count was off for ActivityOne after ActivityTwo closed.", - solo.waitForText("onStart\\(\\) calls: 2")); - - assertTrue("CloseActivityTwoTest failed:" + - "Section Three:" + - "onResume() count was off for ActivityOne after ActivityTwo closed.", - solo.waitForText("onResume\\(\\) calls: 2")); - - assertTrue("CloseActivityTwoTest failed:" + - "Section Three:" + - "onRestart() count was off for ActivityOne after ActivityTwo closed.", - solo.waitForText("onRestart\\(\\) calls: 1")); - - } - -} diff --git a/app/src/androidTest/java/course/labs/activitylab/tests/Test6_ReopenActivityTwoTest.java b/app/src/androidTest/java/course/labs/activitylab/tests/Test6_ReopenActivityTwoTest.java deleted file mode 100644 index e4feea0a3bde7f889e6a9f07d9bc2fc62667a0a2..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/course/labs/activitylab/tests/Test6_ReopenActivityTwoTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package course.labs.activitylab.tests; - -import android.test.ActivityInstrumentationTestCase2; - -import com.robotium.solo.Solo; - -import course.labs.activitylab.ActivityOne; - -@SuppressWarnings("ALL") -public class Test6_ReopenActivityTwoTest extends ActivityInstrumentationTestCase2<ActivityOne> { - - private Solo solo; - - public Test6_ReopenActivityTwoTest() { - super(ActivityOne.class); - } - - public void setUp() throws Exception { - solo = new Solo(getInstrumentation(), getActivity()); - } - - protected void tearDown() throws Exception { - solo.finishOpenedActivities(); - } - - // Executes the ReopenActivityTwoTest - public void testRun() { - - // ==================== Section One ===================== - // Wait for activity: 'course.labs.activitylab.ActivityOne' - int timeout = 20000; - assertTrue("ReopenActivityTwoTest failed:" + - "Section One:" + - "ActivityOne did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - - // ==================== Section Two ===================== - // Click on Start Activity Two - solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo)); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("ReopenActivityTwoTest failed:" + - "Section Two:" + - "ActivityTwo did not load correctly", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - int sleep = 1000; - solo.sleep(sleep); - - // ==================== Section Three ===================== - // Click on Close Activity - solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bClose)); - - // Wait for activity: 'course.labs.activitylab.ActivityOne' - assertTrue("ReopenActivityTwoTest failed:" + - "Section Three:" + - "ActivityTwo did not close correctly", - solo.waitForActivity(course.labs.activitylab.ActivityOne.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bLaunchActivityTwo); - - solo.sleep(sleep); - - // ==================== Section Four ===================== - // Click on Start Activity Two - solo.clickOnView(solo.getView(course.labs.activitylab.R.id.bLaunchActivityTwo)); - - // Wait for activity: 'course.labs.activitylab.ActivityTwo' - assertTrue("ReopenActivityTwoTest failed:" + - "Section Four:" + - "ActivityTwo did not reopen correctly after being closed", - solo.waitForActivity(course.labs.activitylab.ActivityTwo.class, timeout)); - - solo.waitForView(course.labs.activitylab.R.id.bClose); - - // Check for proper counts - assertTrue("ReopenActivityTwoTest failed:" + - "Section Four:" + - "onCreate() count was off for ActivityTwo after being reopened for a second time.", - solo.waitForText("onCreate\\(\\) calls: 1")); - - assertTrue("ReopenActivityTwoTest failed:" + - "Section Four:" + - "onStart() count was off for ActivityTwo after being reopened for a second time.", - solo.waitForText("onStart\\(\\) calls: 1")); - - assertTrue("ReopenActivityTwoTest failed:" + - "Section Four:" + - "onResume() count was off for ActivityTwo after being reopened for a second time.", - solo.waitForText("onResume\\(\\) calls: 1")); - - assertTrue("ReopenActivityTwoTest failed:" + - "Section Four:" + - "onRestart() count was off for ActivityTwo after being reopened for a second time.", - solo.waitForText("onRestart\\(\\) calls: 0")); - - - } - -} diff --git a/app/src/androidTest/res/.gitkeep b/app/src/androidTest/res/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index 46d261ccee95fbae62ed8b4ebfe8e78dd308e0be..0000000000000000000000000000000000000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="course.labs.activitylab" - android:versionCode="1" - android:versionName="1.0" > - - <application - android:allowBackup="true" - android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" - android:theme="@style/AppTheme" > - <activity - android:name=".ActivityOne" - android:label="@string/app_name" > - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - <activity - android:name=".ActivityTwo" - android:label="@string/title_activity_activity_two" > - </activity> - </application> - -</manifest> \ No newline at end of file diff --git a/app/src/main/java/course/labs/activitylab/ActivityOne.java b/app/src/main/java/course/labs/activitylab/ActivityOne.java deleted file mode 100644 index 6a8b75e6e17c84d547a5f584d661e4b47adc3b38..0000000000000000000000000000000000000000 --- a/app/src/main/java/course/labs/activitylab/ActivityOne.java +++ /dev/null @@ -1,159 +0,0 @@ -package course.labs.activitylab; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; - -public class ActivityOne extends Activity { - - private static final String RESTART_KEY = "restart"; - private static final String RESUME_KEY = "resume"; - private static final String START_KEY = "start"; - private static final String CREATE_KEY = "create"; - - // String for LogCat documentation - private final static String TAG = "Lab-ActivityOne"; - - // Lifecycle counters - - // TODO: - // Create counter variables for onCreate(), onRestart(), onStart() and - // onResume() - - - // TODO: Create variables for each of the TextViews - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_one); - - // TODO: Assign the appropriate TextViews to the TextView variables - // Hint: Access the TextView by calling Activity's findViewById() - // textView1 = (TextView) findViewById(R.id.textView1); - - - Button launchActivityTwoButton = findViewById(R.id.bLaunchActivityTwo); - launchActivityTwoButton.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - // TODO: - // Launch Activity Two - // Hint: use Context's startActivity() method - - // Create an intent stating which Activity you would like to start - - // Launch the Activity using the intent - - } - }); - - // Has previous state been saved? - if (savedInstanceState != null) { - - // TODO: - // Restore value of counters from saved state - - } - - // Emit LogCat message - Log.i(TAG, "Entered the onCreate() method"); - - // TODO: - // Update the appropriate count variable - // Update the user interface via the displayCounts() method - - - } - - // Lifecycle callback overrides - - @Override - public void onStart() { - super.onStart(); - - // Emit LogCat message - Log.i(TAG, "Entered the onStart() method"); - - // TODO: - // Update the appropriate count variable - // Update the user interface - - } - - @Override - public void onResume() { - super.onResume(); - - // Emit LogCat message - Log.i(TAG, "Entered the onResume() method"); - - // TODO: - // Update the appropriate count variable - // Update the user interface - - } - - @Override - public void onPause() { - super.onPause(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - } - - @Override - public void onStop() { - super.onStop(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - } - - @Override - public void onRestart() { - super.onRestart(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - - // TODO: - // Update the appropriate count variable - // Update the user interface - - } - - @Override - public void onDestroy() { - super.onDestroy(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - - } - - @Override - public void onSaveInstanceState(Bundle savedInstanceState) { - // TODO: - // Save state information with a collection of key-value pairs - } - - // Updates the displayed counters - private void displayCounts() { - - // TODO: - // Update the user interface via the 4 counter variables - - } -} diff --git a/app/src/main/java/course/labs/activitylab/ActivityTwo.java b/app/src/main/java/course/labs/activitylab/ActivityTwo.java deleted file mode 100644 index 345e7b523aca652d34b91c2430de9089651ed40a..0000000000000000000000000000000000000000 --- a/app/src/main/java/course/labs/activitylab/ActivityTwo.java +++ /dev/null @@ -1,158 +0,0 @@ -package course.labs.activitylab; - -import android.app.Activity; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; - -public class ActivityTwo extends Activity { - - private static final String RESTART_KEY = "restart"; - private static final String RESUME_KEY = "resume"; - private static final String START_KEY = "start"; - private static final String CREATE_KEY = "create"; - - // String for LogCat documentation - private final static String TAG = "Lab-ActivityTwo"; - - // Lifecycle counters - - // TODO: - // Create counter variables for onCreate(), onRestart(), onStart() and - // onResume() - // You will need to increment these variables' values when their - // corresponding lifecycle methods get called - - - // TODO: Create variables for each of the TextViews - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_two); - - // TODO: Assign the appropriate TextViews to the TextView variables - // Hint: Access the TextView by calling Activity's findViewById() - // textView1 = (TextView) findViewById(R.id.textView1); - - - Button closeButton = findViewById(R.id.bClose); - closeButton.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - - // TODO: - // This function closes Activity Two - - - - } - }); - - // Has previous state been saved? - if (savedInstanceState != null) { - - // TODO: - // Restore value of counters from saved state - - } - - // Emit LogCat message - - Log.i(TAG, "Entered the onCreate() method"); - - // TODO: - // Update the appropriate count variable - - } - - // Lifecycle callback methods overrides - - @Override - public void onStart() { - super.onStart(); - - // Emit LogCat message - Log.i(TAG, "Entered the onStart() method"); - - // TODO: - // Update the appropriate count variable - // Update the user interface - - } - - @Override - public void onResume() { - super.onResume(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - - // TODO: - // Update the appropriate count variable - - } - - @Override - public void onPause() { - super.onPause(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - } - - @Override - public void onStop() { - super.onStop(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - } - - @Override - public void onRestart() { - super.onRestart(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - - // TODO: - // Update the appropriate count variable - - } - - @Override - public void onDestroy() { - super.onDestroy(); - - // TODO: - // Emit LogCat message - // Follow the previous 2 examples provided - } - - @Override - public void onSaveInstanceState(Bundle savedInstanceState) { - - // TODO: - // Save counter state information with a collection of key-value pairs - // 4 lines of code, one for every count variable - - } - - // Updates the displayed counters - private void displayCounts() { - - // TODO: - // Update the user interface with the 4 counter variables - - - } -} diff --git a/app/src/main/res/layout/activity_one.xml b/app/src/main/res/layout/activity_one.xml deleted file mode 100644 index a9c1cf78e745c623d17c6a40fb1f18ebd7f9a1b0..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_one.xml +++ /dev/null @@ -1,31 +0,0 @@ -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <TextView android:id="@+id/create" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onCreate" /> - - <TextView android:id="@+id/start" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onStart" /> - - <TextView android:id="@+id/resume" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onResume" /> - - <TextView android:id="@+id/restart" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onRestart" /> - - <Button android:id="@+id/bLaunchActivityTwo" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/button" /> - -</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_two.xml b/app/src/main/res/layout/activity_two.xml deleted file mode 100644 index fe23337df67ad62e3174280711c749a01319e897..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_two.xml +++ /dev/null @@ -1,32 +0,0 @@ -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <TextView android:id="@+id/create" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onCreate" /> - - <TextView android:id="@+id/start" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onStart" /> - - <TextView android:id="@+id/resume" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onResume" /> - - <TextView android:id="@+id/restart" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/onRestart" /> - - <Button android:id="@+id/bClose" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/close" - /> - -</LinearLayout> \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 0e79b184fcf8cc47dede6d7ccde00d1a1e2d9c23..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-ldpi/ic_launcher.png b/app/src/main/res/mipmap-ldpi/ic_launcher.png deleted file mode 100644 index ebfac7d78b9e17c113f734d10af74bd2b100beba..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-ldpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 1183441937efcae0151b75099bec444d034886e9..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index c8ab2a114716b712ec0c5122f9e9524afaa60b52..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml deleted file mode 100644 index ea863b3e7ee7c735bac513ce6078c5b25046b05f..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - - <string name="app_name">ActivityLab</string> - <string name="onCreate">onCreate() calls: 0</string> - <string name="onStart">onStart() calls: 0</string> - <string name="onResume">onResume() calls: 0</string> - <string name="onRestart">onRestart() calls: 0</string> - <string name="button">Start Activity Two</string> - <string name="title_activity_activity_two">Activity Two</string> - <string name="close">Close Activity</string> - -</resources> \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml deleted file mode 100644 index 4a10ca492dd2610011d3979b4dc551f471fa27ab..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ -<resources> - - <!-- - Base application theme, dependent on API level. This theme is replaced - by AppBaseTheme from res/values-vXX/styles.xml on newer devices. - --> - <style name="AppBaseTheme" parent="android:Theme.Light"> - <!-- - Theme customizations available in newer API levels can go in - res/values-vXX/styles.xml, while customizations related to - backward-compatibility can go here. - --> - </style> - - <!-- Application theme. --> - <style name="AppTheme" parent="AppBaseTheme"> - <!-- All customizations that are NOT specific to a particular API-level can go here. --> - </style> - -</resources> \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 8674409cc64f09406fc5792870881826b40393f3..0000000000000000000000000000000000000000 --- a/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - } -} - -allprojects { - repositories { - jcenter() - } -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a8698b08ecc4158d828ca593c4928e9dd..0000000000000000000000000000000000000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 34e12dbb69b48046629a076f2e471be9c8caa1f6..0000000000000000000000000000000000000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Sep 08 12:02:35 EDT 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/gradlew b/gradlew deleted file mode 100755 index 91a7e269e19dfc62e27137a0b57ef3e430cee4fd..0000000000000000000000000000000000000000 --- a/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 8a0b282aa6885fb573c106b3551f7275c5f17e8e..0000000000000000000000000000000000000000 --- a/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e7b4def49cb53d9aa04228dd3edb14c9e635e003..0000000000000000000000000000000000000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app'