From 5c50410ba455df6beb1ffc557648d5e871a08211 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 5 May 2015 19:58:25 -0400 Subject: [PATCH 01/43] Update 8_Intro-Final-Project.md --- lessons/8_Intro-Final-Project.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lessons/8_Intro-Final-Project.md b/lessons/8_Intro-Final-Project.md index b840b80f..c9aecdd4 100644 --- a/lessons/8_Intro-Final-Project.md +++ b/lessons/8_Intro-Final-Project.md @@ -15,6 +15,11 @@ Today we'll go over the [requirements](https://github.com/accesscode-2-1/unit-1/ for the Unit 1 final project. > Exercise: Work with your team to design the project and figure out division of labor. +> 1. Make a git repo for work & make sure both partners can push. +> 2. Create design for app. +> 3. Put together a schedule for group work. +> 4. Figure out who is taking what parts. +> 5. Create your skeleton project & push to github. #### Assessment From d28af4b8c873d9a7871fb411a89a62355f40a1e3 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 5 May 2015 19:58:47 -0400 Subject: [PATCH 02/43] Update 8_Intro-Final-Project.md --- lessons/8_Intro-Final-Project.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lessons/8_Intro-Final-Project.md b/lessons/8_Intro-Final-Project.md index c9aecdd4..092e43d7 100644 --- a/lessons/8_Intro-Final-Project.md +++ b/lessons/8_Intro-Final-Project.md @@ -15,10 +15,15 @@ Today we'll go over the [requirements](https://github.com/accesscode-2-1/unit-1/ for the Unit 1 final project. > Exercise: Work with your team to design the project and figure out division of labor. + > 1. Make a git repo for work & make sure both partners can push. + > 2. Create design for app. + > 3. Put together a schedule for group work. + > 4. Figure out who is taking what parts. + > 5. Create your skeleton project & push to github. #### Assessment From 734b54facb490d45d3a4ba3aa047a484f2d3b9d8 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Wed, 6 May 2015 11:40:07 -0400 Subject: [PATCH 03/43] creating weekend lesson plans --- lessons/10_Github-Debugging.md | 0 lessons/11_Android-UI-Basics.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lessons/10_Github-Debugging.md create mode 100644 lessons/11_Android-UI-Basics.md diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md new file mode 100644 index 00000000..e69de29b diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md new file mode 100644 index 00000000..e69de29b From 27996541c485996ff3c17f9b7140001b76a8d1be Mon Sep 17 00:00:00 2001 From: Alex Qin Date: Thu, 7 May 2015 11:55:35 -0400 Subject: [PATCH 04/43] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 51e58500..67886b68 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,4 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! |---|---| | Apr 25 |
  • **READ** Think Piece: [How to Impress an Interviewer](https://medium.com/@joulee/how-to-impress-an-interviewer-c210d9d8e84a)
  • **WRITE** a Medium post about something technical or non technical you learned this week
  • **GUEST SPEAKER** [Vin Vacanti](speakers/vin-vacanti.md)
| May 1 |
  • **CODE:** [OOP](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-0.md)
  • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
  • **WRITE** a Medium post about something technical or non technical you learned this week
+| May 8 |
  • **CODE:** [Horoscope App](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-1.md)
  • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
  • **WRITE** a Medium post about something technical or non technical you learned this week
From 803163d81b2e0a582ee5961cdb981bf6b8503bf2 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 12:11:22 -0400 Subject: [PATCH 05/43] outlines for the day --- lessons/10_Github-Debugging.md | 28 ++++++++++++++++++++++++++++ lessons/11_Android-UI-Basics.md | 15 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index e69de29b..6ba7ffa9 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -0,0 +1,28 @@ +### Github and Debugging + +#### Objective +Students will learn general software engineering practices and will be able +to navigate Git, have more available debugging tools at their disposal, +and learn the basics of exception handling. + +#### Pre-Work + +[Github & Git Foundations](https://www.youtube.com/playlist?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-) + +#### Do Now (Morning) + +#### Do Now (Afternoon) + +#### Debugging Basics + +##### Printing + +##### Logging + +##### Reading Stack Traces + +#### Exception Handling + +#### Assessment + + diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index e69de29b..339005c3 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -0,0 +1,15 @@ +### Android UI Basics + +#### Objective + +#### Do Now (Morning) + +#### Lesson (Morning) + +#### Do Now (Afternoon) + +#### Code Review + +#### Group Project + +#### Assessment From 62f8953c069134ccf1c00dc0ede8c5a508febeb2 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 13:54:55 -0400 Subject: [PATCH 06/43] added github exercises --- lessons/10_Github-Debugging.md | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 6ba7ffa9..ed7d447c 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -11,8 +11,57 @@ and learn the basics of exception handling. #### Do Now (Morning) +Create a new Java class to do the following string operations: +* Reverse - "Quispe" -> "epsiuQ" +* Uppercase words - "i love java" -> "I Love Java" +* Reverse words - "Java Love I" -> "I Love Java" + +#### Git and Github + +*Git* is a version control system. *Github* is a very popular website for storing git repositories and collaborating. + +> Exercise: Partner with the other person at your table. + +> Part I: Fork and Pull +> 1. Create a repository on Github. +> 1. Clone the repository locally, add the Do Now, and push the change to Github. +> 1. Fork your partner's repository. +> 1. Clone the fork of your partner's repository locally. +> 1. Set the upstream to your partner's repository. +> 1. Create a new branch and make changes to the file in your partner's repository. +> 1. Commit and push this change to Github. +> 1. Open a pull request to your partner's repository master. +> 1. Code review the pull request from your partner. +> 1. Respond to all the changes requested on your pull request (either make the change or push back), and push your changes. +> 1. Accept your partner's pull request. + +> Part II: Merge Conflict +> 1. Make your partner a collaborator on your repository. +> 1. Sync your local clone of your repository to origin master. +> 1. Clone your partner's repository locally. +> 1. Make changes to the file in your partner's repository and push. +> 1. Make changes to the file in your own repository and commit. +> 1. Before pushing, sync to origin master. +> 1. Resolve any merge conflicts. +> 1. Push your changes to your repository. + +> Part III: Shared repository +> 1. Sync your local clone of your partner's repository to origin master. +> 1. Create a new branch on your partner's repository. +> 1. Push this branch to Github. +> 1. Make changes to the file on this branch and push. +> 1. Open a pull request from this branch to master. +> 1. Code review your partner's pull request on your repository. +> 1. Respond to all comments on your partner's code review on your pull request (either make changes or push back) and push your changes. +> 1. Go back and forth code reviewing and responding to comments until all comments are resolved. +> 1. If comments can't be resolved, ask a third party to weigh in on your pull requst. +> 1. Once all comments are resolved, accept your partner's pull request. +> 1. Sync your local clones of your repositories to origin master, and delete all resolved branches. + #### Do Now (Afternoon) +Find the pull request for your reviewee from this week's code review. Download and run their horoscope app. If there are any problems with the pull request, please work with your reviewee to fix this pull request. + #### Debugging Basics ##### Printing @@ -21,6 +70,8 @@ and learn the basics of exception handling. ##### Reading Stack Traces +##### Using the Debugger + #### Exception Handling #### Assessment From 0ff17ecb1d65125fbe3395d4069156d603b6c5c7 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 15:02:27 -0400 Subject: [PATCH 07/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index ed7d447c..8aaf430c 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -23,39 +23,69 @@ Create a new Java class to do the following string operations: > Exercise: Partner with the other person at your table. > Part I: Fork and Pull + > 1. Create a repository on Github. + > 1. Clone the repository locally, add the Do Now, and push the change to Github. + > 1. Fork your partner's repository. + > 1. Clone the fork of your partner's repository locally. + > 1. Set the upstream to your partner's repository. + > 1. Create a new branch and make changes to the file in your partner's repository. + > 1. Commit and push this change to Github. + > 1. Open a pull request to your partner's repository master. + > 1. Code review the pull request from your partner. + > 1. Respond to all the changes requested on your pull request (either make the change or push back), and push your changes. + > 1. Accept your partner's pull request. > Part II: Merge Conflict + > 1. Make your partner a collaborator on your repository. + > 1. Sync your local clone of your repository to origin master. + > 1. Clone your partner's repository locally. + > 1. Make changes to the file in your partner's repository and push. + > 1. Make changes to the file in your own repository and commit. + > 1. Before pushing, sync to origin master. + > 1. Resolve any merge conflicts. + > 1. Push your changes to your repository. > Part III: Shared repository + > 1. Sync your local clone of your partner's repository to origin master. + > 1. Create a new branch on your partner's repository. + > 1. Push this branch to Github. + > 1. Make changes to the file on this branch and push. + > 1. Open a pull request from this branch to master. + > 1. Code review your partner's pull request on your repository. + > 1. Respond to all comments on your partner's code review on your pull request (either make changes or push back) and push your changes. + > 1. Go back and forth code reviewing and responding to comments until all comments are resolved. + > 1. If comments can't be resolved, ask a third party to weigh in on your pull requst. + > 1. Once all comments are resolved, accept your partner's pull request. + > 1. Sync your local clones of your repositories to origin master, and delete all resolved branches. #### Do Now (Afternoon) From 50c71b5ab8008012c6288865420d51fe40193ca3 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 15:59:21 -0400 Subject: [PATCH 08/43] adding debug exercise --- .../10_Github-Debugging/src/BuggyClass.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 exercises/10_Github-Debugging/src/BuggyClass.java diff --git a/exercises/10_Github-Debugging/src/BuggyClass.java b/exercises/10_Github-Debugging/src/BuggyClass.java new file mode 100644 index 00000000..1e5ef256 --- /dev/null +++ b/exercises/10_Github-Debugging/src/BuggyClass.java @@ -0,0 +1,62 @@ +class BuggyClass { + static int N = 1000*1000; + static int TRIES = 100; + static int TOLERANCE = 10; + + static int used_loop = 0; + static int used_recursive = 0; + static int used_divide_and_conquer = 0; + + public static void main(String args) { + int[] A = new int[N]; + int BIG = 1000*1000*1000; + long correct_sum = 0; + for(int i=0; i p; + } + + public static int sum_loop(int[] A){ + int sum = 0; + for(int i=0; i<=A.length; i++) { + sum += A[i]; + } + return sum; + } + + public static int sum_recursive(int i, int[] A){ + if(i==A.length - 1) { + return 0; } + return A[i+1] + sum_recursive(i+1, A); + } + + public static int sum_divide_and_conquer(int lo, int hi, int[] A) { + int mid = A.length/2; + if(lo==hi) { + return A[0]; } + return sum_divide_and_conquer(lo, mid, A) + sum_divide_and_conquer(mid, hi, A); + } + +} \ No newline at end of file From 30bb0ce05ce794a7934d6ae4aebe01c4d3e8b86d Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 16:10:29 -0400 Subject: [PATCH 09/43] fixed up BuggyClass --- exercises/10_Github-Debugging/src/BuggyClass.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/10_Github-Debugging/src/BuggyClass.java b/exercises/10_Github-Debugging/src/BuggyClass.java index 1e5ef256..9ea7c1e9 100644 --- a/exercises/10_Github-Debugging/src/BuggyClass.java +++ b/exercises/10_Github-Debugging/src/BuggyClass.java @@ -1,4 +1,4 @@ -class BuggyClass { +public class BuggyClass { static int N = 1000*1000; static int TRIES = 100; static int TOLERANCE = 10; @@ -7,7 +7,7 @@ class BuggyClass { static int used_recursive = 0; static int used_divide_and_conquer = 0; - public static void main(String args) { + public static void main(String[] args) { int[] A = new int[N]; int BIG = 1000*1000*1000; long correct_sum = 0; From 198c15d365cc9881fbd7bbf9085b72d86d242f41 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 19:40:40 -0400 Subject: [PATCH 10/43] Update 10_Github-Debugging.md Added Excepti --- lessons/10_Github-Debugging.md | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 8aaf430c..f0e733d2 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -15,6 +15,7 @@ Create a new Java class to do the following string operations: * Reverse - "Quispe" -> "epsiuQ" * Uppercase words - "i love java" -> "I Love Java" * Reverse words - "Java Love I" -> "I Love Java" +* Parse Addition Expression - "3 + (4 + 2)" -> "9". Assume that the only operations are "+" and parentheses. #### Git and Github @@ -96,14 +97,61 @@ Find the pull request for your reviewee from this week's code review. Download a ##### Printing +Printing is a very useful debugging method that you've probably already touched. + ##### Logging + + ##### Reading Stack Traces +Stack traces tell you where + ##### Using the Debugger +> Exercise: Debug [BuggyClass](exercises/10_Github-Debugging/src/BuggyClass.java). BuggyClass attemps to compare several different array addition algorithms, but it's fraught with bugs. Remember, bugs are problems with functionality, not just crashing. It may be tricky to infer what someone *meant* to do with the code - in the future you may have to deal with (and fix!) poorly-documented code written by someone who is no longer at the company, or is otherwise not contactable. + #### Exception Handling +Exceptions are errors generated by your program. These errors normally crash your program, but you can write code to `catch` them and recover. + +First, let's see how to raise an exception. For example, let's say you had a `myDivide` method. Since dividing by zero isn't defined arithmetically, we should raise an exception. + +``` +public static double myDivide(int dividend, int divisor) { + if(divisor == 0){ + throw new IllegalArgumentException("Dividing By Zero"); + } + // implement division here + . + . + . +} +``` + +Once an exception is raised, calling code may handle it. For example, let's say you are using the `myDivide` API for a calculator application. + +``` +public static void myCalculator(String userInput) { + . + . // parse userInput + . + . + try { + myDivide(num1, num2); + } + catch (IllegalArgumentException e) { + alert_user(e.getMessage()); + } + . + . + . + . +} +``` + +Here, we use the exception to alert the user as to what went wrong. Exceptions propogate up the call stack, so the method that called `myCalculator` can also handle the exception. If the exception gets to the top of the call stack, then the program crashes. + #### Assessment From 4c3e219394178ebe826675ba09c631a227f6f88b Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 19:51:12 -0400 Subject: [PATCH 11/43] Update 10_Github-Debugging.md added stack traces --- lessons/10_Github-Debugging.md | 35 +++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index f0e733d2..6f5b334e 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -95,17 +95,42 @@ Find the pull request for your reviewee from this week's code review. Download a #### Debugging Basics -##### Printing +##### Printing and Logging -Printing is a very useful debugging method that you've probably already touched. +Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). -##### Logging +##### Reading Stack Traces +Stack traces explain the series of method calls that have led to the current state. For example: +``` +Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1000000 + at BuggyClass.sum_loop(BuggyClass.java:44) + at BuggyClass.find_sum(BuggyClass.java:29) + at BuggyClass.main(BuggyClass.java:19) <5 internal calls> +``` -##### Reading Stack Traces +Means that `main` called `find_sum` on line 19, `find_sum` called `sum_loop` on line 29, and `sum_loop` received an `ArrayIndexOutOfBoundsException` on line 44. On the other hand: + +``` +Exception in thread "main" java.lang.StackOverflowError + at BuggyClass.sum_recursive(BuggyClass.java:50) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + at BuggyClass.sum_recursive(BuggyClass.java:52) + . + . + . +``` -Stack traces tell you where +means that `sum_recursive` infinitely calls itself and eventually crashes. ##### Using the Debugger From 6f51eaaaea382d7af5b6483edf90ae575a5a7643 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 23:31:39 -0400 Subject: [PATCH 12/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 6f5b334e..6f88adaa 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -21,6 +21,34 @@ Create a new Java class to do the following string operations: *Git* is a version control system. *Github* is a very popular website for storing git repositories and collaborating. +Some basic git commands: + +| Command | Description | +|---------|-------------| +| git init | Creates a new git repository | +| git clone [path] | Creates a local copy of a repository | +| git add | Adds a file or directory to staging | +| git rm | Adds the removal of a file or directory to staging | +| git commit | Commits staged changes to head | +| git push origin [branch] | Push changes to [branch] at remote | +| git status | Lists staged changes and changes that have not get been staged | +| git fetch | Get remote changes | +| git pull | Get remote changes and merge | +| git branch | List branches and indicate current branch | +| git branch [branchname] | Create new branch called [branchname] | +| git checkout [branchname] | Switch to branch called [branchname] | +| git checkout -b [branchname] | Create a new branch called [branchname] and switch to it | +| git blame | Revision and author of a line of the file | +| git log | Show commit logs | +| git diff | Show changes between commits | + +Other vocabulary: +* Fork: A copy of a repository. +* Master: The main branch. +* Origin: The remote repository. +* Upstream: The repository that origin copied. +* Branch: A series of changes starting at a particular commit. + > Exercise: Partner with the other person at your table. > Part I: Fork and Pull @@ -95,9 +123,12 @@ Find the pull request for your reviewee from this week's code review. Download a #### Debugging Basics -##### Printing and Logging +##### Variable Scope -Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). +A few rules about variable scope: +* Anything declared between {} belongs only to that block. This also goes for the signature of a loop. +* Anything declared in a method only exists for the scope of that method. +* Reference class variables using the `this` keyword. ##### Reading Stack Traces @@ -132,8 +163,14 @@ Exception in thread "main" java.lang.StackOverflowError means that `sum_recursive` infinitely calls itself and eventually crashes. +##### Printing and Logging + +Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). + ##### Using the Debugger +The debugger allows you to set breakpoints in your code. When you run your code, the execution stops when it reaches a breakpoint. At this point, you can inspect the current state of the program as well as step through the code line by line. + > Exercise: Debug [BuggyClass](exercises/10_Github-Debugging/src/BuggyClass.java). BuggyClass attemps to compare several different array addition algorithms, but it's fraught with bugs. Remember, bugs are problems with functionality, not just crashing. It may be tricky to infer what someone *meant* to do with the code - in the future you may have to deal with (and fix!) poorly-documented code written by someone who is no longer at the company, or is otherwise not contactable. #### Exception Handling @@ -177,6 +214,10 @@ public static void myCalculator(String userInput) { Here, we use the exception to alert the user as to what went wrong. Exceptions propogate up the call stack, so the method that called `myCalculator` can also handle the exception. If the exception gets to the top of the call stack, then the program crashes. -#### Assessment +#### Bonus +[Project Euler Problem 20](https://projecteuler.net/problem=20) + +#### Assessment +What does the first line in the call stack indicate? From d635cf55ce01b2131c0742b14b117a6e9e27cdf6 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 23:39:10 -0400 Subject: [PATCH 13/43] Update README.md --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 67886b68..5f3bbfeb 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,14 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! 0 | Apr 21 | 0 | [Android Prework](lessons/0_Android-Prework.md) 1 | Apr 23 | 0 | [Android Studio & Structure of an Android Project](lessons/1_Android-Studio-Structure-of-Android-Project.md) 2 | Apr 25 | 0 | [Inheritance and Interfaces](lessons/2_Interfaces-And-Inheritance) - 3 | Apr 26 | 0 | [Generics and Abstract Classes](/lessons/3_Generics-and-Abstract-Classes.md) + 3 | Apr 26 | 1 | [Generics and Abstract Classes](/lessons/3_Generics-and-Abstract-Classes.md) 4 | Apr 28 | 1 | [Anatomy of the Android Manifest](/lessons/4_Anatomy_Manifest.md) - 5 | May 02 | 1 | [Android Resources] (lessons/6_Android-Resources.md) - 6 | May 03 | 1 | [Activity Lifecycle](lessons/7_Android-Lifecycle.md) + 5 | Apr 30 | 1 | [OOP and Intents](exercises/5_OOP-and-Intents) + 6 | May 02 | 1 | [Android Resources] (lessons/6_Android-Resources.md) + 7 | May 03 | 2 | [Activity Lifecycle](lessons/7_Android-Lifecycle.md) + 8 | May 05 | 2 | [Intro to Final Project](lessons/8_Intro-Final-Project.md) + 9 | May 07 | 2 | [Android Exercises](https://github.com/shurane/unit-1-exercises) + 10 | May 09 | 2 | [Github and Debugging](lessons/10_Github-Debugging.md) ### Homework | Due Date | Homework| @@ -20,3 +24,4 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! | Apr 25 |
  • **READ** Think Piece: [How to Impress an Interviewer](https://medium.com/@joulee/how-to-impress-an-interviewer-c210d9d8e84a)
  • **WRITE** a Medium post about something technical or non technical you learned this week
  • **GUEST SPEAKER** [Vin Vacanti](speakers/vin-vacanti.md)
| May 1 |
  • **CODE:** [OOP](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-0.md)
  • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
  • **WRITE** a Medium post about something technical or non technical you learned this week
| May 8 |
  • **CODE:** [Horoscope App](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-1.md)
  • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
  • **WRITE** a Medium post about something technical or non technical you learned this week
+| May 15 |
  • **CODE:** From 31ce2e4a9f04695363427f9b247c4a239d0f91f2 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 23:41:05 -0400 Subject: [PATCH 14/43] Create week-2.md --- homework/week-2.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 homework/week-2.md diff --git a/homework/week-2.md b/homework/week-2.md new file mode 100644 index 00000000..e83f7e46 --- /dev/null +++ b/homework/week-2.md @@ -0,0 +1,13 @@ +##Homework + +##### Exercise 1: Code Review + +Find your name in the first column; code review the developer in the second column. + +| Reviewer | Reviewee | +|----------|----------| + +It is on you to have communication with your reviewer/reviewee in order to complete this assignment. + +##### Exercise 2: Revenge of the Horoscope App + From 1786bc403f412c5d22039fb85096cab75f5d4599 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 23:41:51 -0400 Subject: [PATCH 15/43] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5f3bbfeb..3b42a5ff 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,6 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! | Due Date | Homework| |---|---| | Apr 25 |
    • **READ** Think Piece: [How to Impress an Interviewer](https://medium.com/@joulee/how-to-impress-an-interviewer-c210d9d8e84a)
    • **WRITE** a Medium post about something technical or non technical you learned this week
    • **GUEST SPEAKER** [Vin Vacanti](speakers/vin-vacanti.md)
    -| May 1 |
    • **CODE:** [OOP](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-0.md)
    • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
    • **WRITE** a Medium post about something technical or non technical you learned this week
    -| May 8 |
    • **CODE:** [Horoscope App](https://github.com/accesscode-2-1/unit-1/blob/master/homework/week-1.md)
    • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
    • **WRITE** a Medium post about something technical or non technical you learned this week
    -| May 15 |
    • **CODE:** +| May 1 |
      • **CODE:** [OOP](homework/week-0.md)
      • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
      • **WRITE** a Medium post about something technical or non technical you learned this week
      +| May 8 |
      • **CODE:** [Horoscope App](homework/week-1.md)
      • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
      • **WRITE** a Medium post about something technical or non technical you learned this week
      +| May 15 |
      • **CODE:** [Revenge of the Horoscope App](homework/week-2.md) From 944a4bb0311eca120c37b4b0d1862f31e0a9f849 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 8 May 2015 23:51:20 -0400 Subject: [PATCH 16/43] Update week-2.md --- homework/week-2.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/homework/week-2.md b/homework/week-2.md index e83f7e46..7f0dd400 100644 --- a/homework/week-2.md +++ b/homework/week-2.md @@ -6,8 +6,49 @@ Find your name in the first column; code review the developer in the second colu | Reviewer | Reviewee | |----------|----------| +| Abass Bayo-Awoyemi | Jaellys Bales +| Allison Bojarski | Madelyn Tavarez +| Alvin Kuang | Kadeem Maragh +| Anthony Fermin | Rosmary Fermin +| Anthony McBride | Joshelyn Vivas +| Charlyn Buchanan | John Gomez +| Dison Ruan | Sufei Zhao +| Elvis Boves | George Syrimis +| George Syrimis | Alvin Kuang +| Hanbi Choi | Pooja Pasawala +| Hoshiko Oki | Jose Garcia +| Jaellys Bales | Jorge Reina +| Janneisy Vidals | Reinard Cox +| John Gomez | Anthony Fermin +| Jorge Reina | Anthony McBride +| Jose Garcia | Luke Lee +| Joshelyn Vivas | Vanice Yee +| Kadeem Maragh | Na Li +| Madelyn Tavarez | Allison Bojarski +| Marbella Vidals | Tasha Smith +| Na Li | Elvis Boves +| Ramona Harrison | Charlyn Buchanan +| Raynaldie Acevedi | Dison Ruan +| Reinard Cox | Ramona Harrison +| Rosmary Fermin | Yuliya Kaleda +| Sarah Kim | Raynaldie Acevedi +| Sufei Zhao | Hanbi Choi +| Tasha Smith | Marbella Vidals +| Vanice Yee | Sarah Kim +| Yuliya Kaleda | Abass Bayo-Awoyemi +| Pooja Pasawala | Hoshiko Oki +| Luke Lee | Janneisy Vidals It is on you to have communication with your reviewer/reviewee in order to complete this assignment. ##### Exercise 2: Revenge of the Horoscope App +* Resolve all comments your reviewer leaves on your app. +* Change the layout of at least two of your existing features. +* Create consistent UI styling across your app. +* Test your app on at least two devices of different screen sizes. +The main purpose of this week's assignment is to play around with the visual elements - have fun with it and iterate with your peers. + +##### Bonus + +Implement bonus features from [last week](homework/week-1.md). From 51d8b6d7dd2bab41bc7c973bcb1aa050a35d8b2a Mon Sep 17 00:00:00 2001 From: davisRoman Date: Sat, 9 May 2015 10:34:03 -0400 Subject: [PATCH 17/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 6f88adaa..25f66a6f 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -49,6 +49,11 @@ Other vocabulary: * Upstream: The repository that origin copied. * Branch: A series of changes starting at a particular commit. +## Git log --graph +[git log graph](https://github.com/davisRoman/git_dag/blob/master/intro_to_the_dag.md) + +----- + > Exercise: Partner with the other person at your table. > Part I: Fork and Pull From ee247ed668f640f7db4bf4c3e401a0b548e9db2c Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 14:29:11 -0400 Subject: [PATCH 18/43] Update week-2.md --- homework/week-2.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homework/week-2.md b/homework/week-2.md index 7f0dd400..36d24fc3 100644 --- a/homework/week-2.md +++ b/homework/week-2.md @@ -50,5 +50,4 @@ It is on you to have communication with your reviewer/reviewee in order to compl The main purpose of this week's assignment is to play around with the visual elements - have fun with it and iterate with your peers. ##### Bonus - -Implement bonus features from [last week](homework/week-1.md). +* Create your own [Style](http://developer.android.com/guide/topics/ui/themes.html). From 3de54ce9e81d67e6d1cd5d7fc106ac1ccb3f0955 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 14:30:19 -0400 Subject: [PATCH 19/43] Update week-2.md --- homework/week-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homework/week-2.md b/homework/week-2.md index 36d24fc3..2a94fa16 100644 --- a/homework/week-2.md +++ b/homework/week-2.md @@ -50,4 +50,4 @@ It is on you to have communication with your reviewer/reviewee in order to compl The main purpose of this week's assignment is to play around with the visual elements - have fun with it and iterate with your peers. ##### Bonus -* Create your own [Style](http://developer.android.com/guide/topics/ui/themes.html). +* Create your own [Theme](http://developer.android.com/guide/topics/ui/themes.html). From f0475084eade7759212ea272aa90d2cb52a2ba8a Mon Sep 17 00:00:00 2001 From: davisRoman Date: Sat, 9 May 2015 14:43:50 -0400 Subject: [PATCH 20/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 25f66a6f..1a03f256 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -168,6 +168,49 @@ Exception in thread "main" java.lang.StackOverflowError means that `sum_recursive` infinitely calls itself and eventually crashes. +### Example: + +```java +public class Main { + + public static void m1(){ + System.out.println("Method one - m1"); + m2(); + } + + public static void m2(){ + System.out.println("Method two - m2"); + + int x= 10; + int y = 0; + + double z = x/y; + + System.out.println(z); + } + + public static void main(String[] args) { + System.out.println("Starting Main method"); + m1(); + System.out.println("End main method"); + } +} +``` +``` +Exception in thread "main" java.lang.ArithmeticException: / by zero +Starting Main method +Method one - m1 +Method two - m2 + at com.company.Main.m2(Main.java:16) + at com.company.Main.m1(Main.java:7) + at com.company.Main.main(Main.java:25) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:606) + at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) +``` + ##### Printing and Logging Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). From 265540de249d691ad9cda4c168967e21a440db3c Mon Sep 17 00:00:00 2001 From: davisRoman Date: Sat, 9 May 2015 14:44:37 -0400 Subject: [PATCH 21/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 1a03f256..26298606 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -169,6 +169,7 @@ Exception in thread "main" java.lang.StackOverflowError means that `sum_recursive` infinitely calls itself and eventually crashes. ### Example: +- Division by zero ```java public class Main { @@ -196,6 +197,7 @@ public class Main { } } ``` +Output: ``` Exception in thread "main" java.lang.ArithmeticException: / by zero Starting Main method From 4f1c9cb3ef42a67e2c3b595e6a2710072b3acad9 Mon Sep 17 00:00:00 2001 From: davisRoman Date: Sat, 9 May 2015 14:46:29 -0400 Subject: [PATCH 22/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 26298606..b8dd3e7f 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -213,10 +213,6 @@ Method two - m2 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) ``` -##### Printing and Logging - -Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). - ##### Using the Debugger The debugger allows you to set breakpoints in your code. When you run your code, the execution stops when it reaches a breakpoint. At this point, you can inspect the current state of the program as well as step through the code line by line. @@ -264,6 +260,10 @@ public static void myCalculator(String userInput) { Here, we use the exception to alert the user as to what went wrong. Exceptions propogate up the call stack, so the method that called `myCalculator` can also handle the exception. If the exception gets to the top of the call stack, then the program crashes. +##### Printing and Logging ( time permitting ) + +Printing is a very useful debugging method that you've probably already touched. Printing is useful because it can help display intermediate program state. Logging is essentially the same method (i.e. writing state to external output). + #### Bonus [Project Euler Problem 20](https://projecteuler.net/problem=20) From f7d1e4ebed976409cb3988ddd5029d6d649e40a5 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 14:50:36 -0400 Subject: [PATCH 23/43] Update 10_Github-Debugging.md fixed link to BuggyClass --- lessons/10_Github-Debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index b8dd3e7f..9cb9b46b 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -217,7 +217,7 @@ Method two - m2 The debugger allows you to set breakpoints in your code. When you run your code, the execution stops when it reaches a breakpoint. At this point, you can inspect the current state of the program as well as step through the code line by line. -> Exercise: Debug [BuggyClass](exercises/10_Github-Debugging/src/BuggyClass.java). BuggyClass attemps to compare several different array addition algorithms, but it's fraught with bugs. Remember, bugs are problems with functionality, not just crashing. It may be tricky to infer what someone *meant* to do with the code - in the future you may have to deal with (and fix!) poorly-documented code written by someone who is no longer at the company, or is otherwise not contactable. +> Exercise: Debug [BuggyClass](../exercises/10_Github-Debugging/src/BuggyClass.java). BuggyClass attemps to compare several different array addition algorithms, but it's fraught with bugs. Remember, bugs are problems with functionality, not just crashing. It may be tricky to infer what someone *meant* to do with the code - in the future you may have to deal with (and fix!) poorly-documented code written by someone who is no longer at the company, or is otherwise not contactable. #### Exception Handling From aec5c26799df6496902cc681f2bd62f1fc8e39b0 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 15:40:36 -0400 Subject: [PATCH 24/43] Update 10_Github-Debugging.md --- lessons/10_Github-Debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/10_Github-Debugging.md b/lessons/10_Github-Debugging.md index 9cb9b46b..077765d0 100644 --- a/lessons/10_Github-Debugging.md +++ b/lessons/10_Github-Debugging.md @@ -270,4 +270,4 @@ Printing is a very useful debugging method that you've probably already touched. #### Assessment -What does the first line in the call stack indicate? +What does the first line in the call stack indicate? ([Exit Ticket](https://docs.google.com/forms/d/1a-gfjjsn35N-C6wrQU9y02vHoYLFaEfjUgD7J91n3rM/viewform?usp=send_form)) From 95f6614f724b3663edeb54302e65380a66fd5f7b Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 19:25:14 -0400 Subject: [PATCH 25/43] adding some Android UI Basics --- lessons/11_Android-UI-Basics.md | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index 339005c3..6bfee0c5 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -2,14 +2,66 @@ #### Objective +Students will learn about the properties of widgets and containers and be more comfortable editing widget properties in the XML. + #### Do Now (Morning) + + #### Lesson (Morning) +Widgets are UI components meant to serve a particular interaction with the user. Containers determine the structure of how widgets are arranged. Here are a few key things to know about widgets: +* Parent/Child: If a widget A is structured within another widget or container B, then A is a child of B, and B is a parent of A. +* Padding vs. Margin: Padding is internal spacing, margin is external spacing. +* match_parent: Fills the space of the parent element. +* wrap_content: Takes up the minimum amount of space needed for the content. +* Structure vs Function: XML displays the structure of a +* Listener: + +> Exercise: Without using the designer, do the following: + +> 1. Create an Android app with a blank Activity. + +> 1. In the main layout, add a button. + +> 1. Add another button positioned underneath the first button. + +> 1. Add another button positioned undernead the second button. + +> 1. Have your buttons display the text 1, 2, and 3 based on their position. + +> 1. Add a button to the right of each button displaying R1, R2, and R3 respectively. + +> 1. Add a TextView under each button. + +> 1. Create an OnClickListener in a new class. + +> 1. Implement a method that increments a class variable OnClick i.e. this variable should count the number of times something has been clicked. + +> 1. Add a constructor to the OnClickListener that takes in a TextView and change OnClick such that it updates the TextView with the # of times the button has been clicked. + +> 1. For each button, add an instance of the OnClickListener and pass in the corresponding TextView. + +> 1. Create a new TextView that displays all the times all of the Buttons have been clicked in total. + +> 1. Exchange code review with the person at your table and resolve all comments. + #### Do Now (Afternoon) +Add TODOs into your horoscope app based on what we learned this morning. + #### Code Review +Code Review a lucky developer's app! + #### Group Project +Spend the rest of the day working on your group project with your team. + #### Assessment + + + +#### Resources +* Videos: +* Textbook: The Theory of Widgets, The Android User Interface, Basic Widgets From 08ab8aeaf0f6b3b6a8d577723f2cfef53318fa06 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 19:44:18 -0400 Subject: [PATCH 26/43] Update 11_Android-UI-Basics.md still need do now and assessment --- lessons/11_Android-UI-Basics.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index 6bfee0c5..0189cd4c 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -6,8 +6,6 @@ Students will learn about the properties of widgets and containers and be more c #### Do Now (Morning) - - #### Lesson (Morning) Widgets are UI components meant to serve a particular interaction with the user. Containers determine the structure of how widgets are arranged. Here are a few key things to know about widgets: @@ -15,8 +13,10 @@ Widgets are UI components meant to serve a particular interaction with the user. * Padding vs. Margin: Padding is internal spacing, margin is external spacing. * match_parent: Fills the space of the parent element. * wrap_content: Takes up the minimum amount of space needed for the content. -* Structure vs Function: XML displays the structure of a -* Listener: +* Structure vs Function: XML displays the structure of the user interface. Function should be definied in Java. When structure needs to be defined in Java, it should be disconnected from function as much as possible. +* Structure vs Style: Structure defines the hierchy in which elements are laid out, while style dictates things such as font color and size. Although both can be defined in XML, these different pieces should also be separated from each other when possible. +* Callbacks: A callback is a piece of code passed to another piece of code, which controls the execution. We will start to see code that asynchronously executes some action. This may be different from the "linear" programs you may have been writing before. We'll see more synchronous/asynchronous items in the future. + > Exercise: Without using the designer, do the following: @@ -60,8 +60,5 @@ Spend the rest of the day working on your group project with your team. #### Assessment - - #### Resources -* Videos: * Textbook: The Theory of Widgets, The Android User Interface, Basic Widgets From 55d30faf049bc0e9a5abb6de61684e6a51bd3685 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sat, 9 May 2015 19:45:12 -0400 Subject: [PATCH 27/43] Update 11_Android-UI-Basics.md --- lessons/11_Android-UI-Basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index 0189cd4c..2b4b4cef 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -15,7 +15,7 @@ Widgets are UI components meant to serve a particular interaction with the user. * wrap_content: Takes up the minimum amount of space needed for the content. * Structure vs Function: XML displays the structure of the user interface. Function should be definied in Java. When structure needs to be defined in Java, it should be disconnected from function as much as possible. * Structure vs Style: Structure defines the hierchy in which elements are laid out, while style dictates things such as font color and size. Although both can be defined in XML, these different pieces should also be separated from each other when possible. -* Callbacks: A callback is a piece of code passed to another piece of code, which controls the execution. We will start to see code that asynchronously executes some action. This may be different from the "linear" programs you may have been writing before. We'll see more synchronous/asynchronous items in the future. +* Callbacks: A callback is a piece of code passed to another piece of code, which controls the execution. We will start to see code that asynchronously executes some action. This may be different from the "linear" programs you may have been writing before. Reasoning about synchronous/asynchronous items will become important in the future. > Exercise: Without using the designer, do the following: From 7626cba7b6a3c6b5a82242f9ebe267f7135dfb90 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sun, 10 May 2015 10:10:32 -0400 Subject: [PATCH 28/43] Update 11_Android-UI-Basics.md --- lessons/11_Android-UI-Basics.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index 2b4b4cef..f4746ac5 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -4,7 +4,9 @@ Students will learn about the properties of widgets and containers and be more comfortable editing widget properties in the XML. -#### Do Now (Morning) +#### Code Review + +Code Review a lucky developer's app! #### Lesson (Morning) @@ -50,9 +52,9 @@ Widgets are UI components meant to serve a particular interaction with the user. Add TODOs into your horoscope app based on what we learned this morning. -#### Code Review +#### Github -Code Review a lucky developer's app! +Work on yesterdays' [Github exercises](10_Github-Debugging.md) #### Group Project From 3539ab6f0dfcc45dc9033490a1efd2f6df2ef1a0 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Sun, 10 May 2015 12:25:28 -0400 Subject: [PATCH 29/43] Update 11_Android-UI-Basics.md --- lessons/11_Android-UI-Basics.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lessons/11_Android-UI-Basics.md b/lessons/11_Android-UI-Basics.md index f4746ac5..77135c09 100644 --- a/lessons/11_Android-UI-Basics.md +++ b/lessons/11_Android-UI-Basics.md @@ -62,5 +62,7 @@ Spend the rest of the day working on your group project with your team. #### Assessment +[Exit Ticket](https://docs.google.com/forms/d/1a-gfjjsn35N-C6wrQU9y02vHoYLFaEfjUgD7J91n3rM/viewform?usp=send_form) + #### Resources * Textbook: The Theory of Widgets, The Android User Interface, Basic Widgets From 901d31185e95728cced8c9a890633cbc3c206153 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:43:27 -0400 Subject: [PATCH 30/43] Create 12_Layouts.md --- lessons/12_Layouts.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lessons/12_Layouts.md diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md new file mode 100644 index 00000000..287fa021 --- /dev/null +++ b/lessons/12_Layouts.md @@ -0,0 +1,42 @@ +## Layouts + +### Do Now + +### Lesson: Layouts + +#### Views and View Groups + +A View is the building block of a basic UI element. Views are bounded by a rectangle and are in charge of event +handling and drawing. A Widget is a type of View. A ViewGroup is also a type of View. + +A ViewGroup is a container class that contains other Views, including ViewGroups. Layouts are a type of ViewGroup. + +#### Layout Basics + +Layouts define the structure of a user interface, typically in the XML, although you can dynamically create +the UI in Java. + +When loading a layout, call `setContentView`. You have probably seen this in your `onCreate`, but take note that +you can change the layout at any time. Activities are not implicitly associated with layouts. + +A Layout is a rectangle - the boundaries of the a Layout are defined by `getLeft()`, `getRight()`, `getTop()`, and +`getBottom()`. You can also use `getHeight()` and `getWidth()` to get the actual size of the Layout box. + +#### Linear Layout + +In a Linear Layout, all the children are aligned either horizontally or vertically, depending on the +`android:orientation`. That is, all the children are placed one after another linearly. + +* Orientation: Vertical for rows, horizonatal for columns. +* Gravity: [Gravity and layout_gravity](http://sandipchitale.blogspot.com/2010/05/linearlayout-gravity-and-layoutgravity.html) +* Weight: Weight describes the relative importance of the Views, which allows these views to expand to fit the +parent proportionally. For example, two views with a weight of 1 will fill the layout at a 1:1 ratio (or, the same +amount), and two views with weights of 1 and 2 will fill the layout with a 1:2 ratio (so, 1/3 and 2/3 of the screen). + +#### Relative Layout + +In a Relative Layout, the children can define their position relative to the parent or the other children available. + +#### Exercises + +#### Quiz From b51ba986873e8db0223adbd0b433a31117981d8b Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:45:17 -0400 Subject: [PATCH 31/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index 287fa021..a076ef32 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -39,4 +39,7 @@ In a Relative Layout, the children can define their position relative to the par #### Exercises +> Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. +> Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. + #### Quiz From 00144c2fbac5e441cad0938dac9f90de743669a5 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:45:28 -0400 Subject: [PATCH 32/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index a076ef32..b2a98dec 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -40,6 +40,7 @@ In a Relative Layout, the children can define their position relative to the par #### Exercises > Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. + > Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. #### Quiz From 8330744985d1af2235883b48bdf402c9196f8f35 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:45:44 -0400 Subject: [PATCH 33/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index b2a98dec..c3c89b72 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -41,6 +41,7 @@ In a Relative Layout, the children can define their position relative to the par > Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. + > Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. #### Quiz From 84e6816e28f2fd6601b33828377d8144e3d03b2b Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:46:02 -0400 Subject: [PATCH 34/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index c3c89b72..0404ea8b 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -39,9 +39,8 @@ In a Relative Layout, the children can define their position relative to the par #### Exercises -> Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. +> 1. Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. - -> Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. +> 1. Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. #### Quiz From b6d1e4d10a9d1ff148d98ceeb89b84187e04f415 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:46:18 -0400 Subject: [PATCH 35/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index 0404ea8b..73d0bd64 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -37,10 +37,10 @@ amount), and two views with weights of 1 and 2 will fill the layout with a 1:2 r In a Relative Layout, the children can define their position relative to the parent or the other children available. -#### Exercises +### Exercises > 1. Create a form using a Linear Layout that asks a user for first and last name, username, DOB, etc. > 1. Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. -#### Quiz +### Quiz From def22e74b396f83b62fc1c5e59ff657031cdce06 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 09:48:02 -0400 Subject: [PATCH 36/43] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3b42a5ff..60382ffb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! 8 | May 05 | 2 | [Intro to Final Project](lessons/8_Intro-Final-Project.md) 9 | May 07 | 2 | [Android Exercises](https://github.com/shurane/unit-1-exercises) 10 | May 09 | 2 | [Github and Debugging](lessons/10_Github-Debugging.md) + 11 | May 10 | 3 | [UI Basics](lessons/11_Android-UI-Basics.md) + 12 | May 12 | 3 | [Layouts](lessons/12_Layouts.md) ### Homework | Due Date | Homework| From fdbfd8f48feafe43e6e44b6ecc2327024a0eb035 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 18:34:19 -0400 Subject: [PATCH 37/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index 73d0bd64..bd135dd6 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -1,7 +1,5 @@ ## Layouts -### Do Now - ### Lesson: Layouts #### Views and View Groups @@ -43,4 +41,8 @@ In a Relative Layout, the children can define their position relative to the par > 1. Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. -### Quiz +### [Quiz](https://docs.google.com/a/c4q.nyc/forms/d/1AZO4SyYgglEzroJqMbEuTTRp3D7TnEBiI--LHcfNTSo/viewform?usp=send_form) + +### Assessment + +[Exit ticket](https://docs.google.com/forms/d/1a-gfjjsn35N-C6wrQU9y02vHoYLFaEfjUgD7J91n3rM/viewform?usp=send_form) From 98569046d00e7f01e29ae7ca58f929237f267f92 Mon Sep 17 00:00:00 2001 From: Jared Poelman Date: Tue, 12 May 2015 20:32:36 -0400 Subject: [PATCH 38/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index bd135dd6..2d35a66a 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -25,7 +25,7 @@ A Layout is a rectangle - the boundaries of the a Layout are defined by `getLeft In a Linear Layout, all the children are aligned either horizontally or vertically, depending on the `android:orientation`. That is, all the children are placed one after another linearly. -* Orientation: Vertical for rows, horizonatal for columns. +* Orientation: Vertical for rows, horizontal for columns. * Gravity: [Gravity and layout_gravity](http://sandipchitale.blogspot.com/2010/05/linearlayout-gravity-and-layoutgravity.html) * Weight: Weight describes the relative importance of the Views, which allows these views to expand to fit the parent proportionally. For example, two views with a weight of 1 will fill the layout at a 1:1 ratio (or, the same From f202b1e48f12e2415b04af272fb8ae91b9af7da9 Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Tue, 12 May 2015 21:27:21 -0400 Subject: [PATCH 39/43] Update 12_Layouts.md --- lessons/12_Layouts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/12_Layouts.md b/lessons/12_Layouts.md index 2d35a66a..2de12d51 100644 --- a/lessons/12_Layouts.md +++ b/lessons/12_Layouts.md @@ -41,7 +41,7 @@ In a Relative Layout, the children can define their position relative to the par > 1. Create a calculator layout using a Linear Layout. Use this opportunity to figure out how to nest layouts. -### [Quiz](https://docs.google.com/a/c4q.nyc/forms/d/1AZO4SyYgglEzroJqMbEuTTRp3D7TnEBiI--LHcfNTSo/viewform?usp=send_form) +### [Quiz](https://docs.google.com/forms/d/1AZO4SyYgglEzroJqMbEuTTRp3D7TnEBiI--LHcfNTSo/viewform?usp=send_form) ### Assessment From 91b7d9d24845ab4a98e06f430fc9d64172adc14c Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Fri, 15 May 2015 14:44:26 -0400 Subject: [PATCH 40/43] Create assessment_prep.md --- exercises/assessment_prep.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 exercises/assessment_prep.md diff --git a/exercises/assessment_prep.md b/exercises/assessment_prep.md new file mode 100644 index 00000000..48da1c93 --- /dev/null +++ b/exercises/assessment_prep.md @@ -0,0 +1,22 @@ +### Assessment Prep + +In order to be prepared for the assessment, make sure you know how to do the following things. If you don't know, +don't just look up how to do it. Practice doing it in an application, several times. + +1. Start a new Android project. + +1. Create a new Activity. + +1. Move between two Activities using Explicit intents. + +1. Open up a new app using Implicit Intents. + +1. Know the order of Activity lifecycle methods for common cases. + +1. Be able to reason about the Activity lifecycle diagram. + +1. Know how to use the resources directory. + +1. Know how to add a widget to a layout and set properties on it. + +1. Know how to use a linear layout, including weight, gravity and layout_gravity. From 41a4f66c46d6db5492581357e197babaf10e4584 Mon Sep 17 00:00:00 2001 From: Alex Qin Date: Sat, 16 May 2015 09:00:01 -0400 Subject: [PATCH 41/43] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60382ffb..9bb8348c 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,5 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! | Apr 25 |
        • **READ** Think Piece: [How to Impress an Interviewer](https://medium.com/@joulee/how-to-impress-an-interviewer-c210d9d8e84a)
        • **WRITE** a Medium post about something technical or non technical you learned this week
        • **GUEST SPEAKER** [Vin Vacanti](speakers/vin-vacanti.md)
        | May 1 |
        • **CODE:** [OOP](homework/week-0.md)
        • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
        • **WRITE** a Medium post about something technical or non technical you learned this week
        | May 8 |
        • **CODE:** [Horoscope App](homework/week-1.md)
        • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
        • **WRITE** a Medium post about something technical or non technical you learned this week
        -| May 15 |
        • **CODE:** [Revenge of the Horoscope App](homework/week-2.md) +| May 15 |
          • **CODE:** [Revenge of the Horoscope App](homework/week-2.md)
          • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
          + From b91133dfe34e95194118de56e9eba018f0a9f42e Mon Sep 17 00:00:00 2001 From: Alex Qin Date: Sat, 16 May 2015 09:00:27 -0400 Subject: [PATCH 42/43] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bb8348c..1e782e30 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,5 @@ Lesson plans, activities and assignments for Unit 1 will be posted here! | Apr 25 |
          • **READ** Think Piece: [How to Impress an Interviewer](https://medium.com/@joulee/how-to-impress-an-interviewer-c210d9d8e84a)
          • **WRITE** a Medium post about something technical or non technical you learned this week
          • **GUEST SPEAKER** [Vin Vacanti](speakers/vin-vacanti.md)
          | May 1 |
          • **CODE:** [OOP](homework/week-0.md)
          • **WATCH** Think Piece: [Carol Dweck: The power of believing that you can improve](http://www.ted.com/talks/carol_dweck_the_power_of_believing_that_you_can_improve)
          • **WRITE** a Medium post about something technical or non technical you learned this week
          | May 8 |
          • **CODE:** [Horoscope App](homework/week-1.md)
          • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
          • **WRITE** a Medium post about something technical or non technical you learned this week
          -| May 15 |
          • **CODE:** [Revenge of the Horoscope App](homework/week-2.md)
          • **READ** Think Piece: [Unlearning Helplessness](http://braythwayt.com/2015/01/20/learned-helplessness.html)
          +| May 15 |
          • **CODE:** [Revenge of the Horoscope App](homework/week-2.md)
          • **READ** Think Piece: [Programming Sucks]( http://www.stilldrinking.org/programming-sucks)
          From 1c2b48105d00d2911b0eaec3293054efa31da94a Mon Sep 17 00:00:00 2001 From: Amy Quispe Date: Thu, 21 May 2015 16:22:36 -0400 Subject: [PATCH 43/43] Update requirements.md --- project/requirements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/requirements.md b/project/requirements.md index 146156bf..4361850d 100644 --- a/project/requirements.md +++ b/project/requirements.md @@ -1,7 +1,7 @@ ### Final Project: Scientific Calculator #### Due Date -A pull request with your code must be issued to the unit-1 `calculator` branch by 18:59 on 5/21 (that is, before class). Presentations will be in class that day. +A pull request with your code must be issued to the [calculator](https://github.com/accesscode-2-1/calculator) repository by 18:59 on 5/21 (that is, before class). Presentations will be in class that day. #### Groups You will work in assigned [groups of two](groups.md).