1 / 41

Lecture 2 agenda flip teaching install p4merge rename project packages review git

Lecture 2 agenda flip teaching install p4merge rename project packages review git review Android Studio (Vinny) layouts and resources java event model labGeoQuizz chapters 1-3. flipping the classroom explained http://en.wikipedia.org/wiki/Flip_teaching

claire
Download Presentation

Lecture 2 agenda flip teaching install p4merge rename project packages review git

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 2 agenda flip teaching install p4merge rename project packages review git review Android Studio (Vinny) layouts and resources java event model labGeoQuizz chapters 1-3

  2. flipping the classroom explained http://en.wikipedia.org/wiki/Flip_teaching Flip teaching (or flipped classroom) is a form of blended learning in which students watch lectures online and work on problem sets with other students in class. This approach allows teachers to spend more time interacting with students instead of lecturing. This is also known as backwards classroom, reverse instruction, flipping the classroom and reverse teaching

  3. Installing an external diff/merge tool: http://www.perforce.com/downloads/Perforce-Software-Version-Management/complete_list/Customer http://www.perforce.com/downloads/ click on Software Version Managment click on Customer Downloads p4Merge + Mac: SourceTree || Preferences || Diff || P4Merge

  4. Open each project and rename your package from jstudent to first-initial-last-name Then push your changes.

  5. GIT architecture

  6. git config --global user.name "Your Name" git config --global user.email "your_email@whatever.com"

  7. add/reset/commit: move files from working-dir to stage-dir(aka index) git add . git add res/. git add src/. git add res/values/strings.xml move files from stage-dir(aka index) to working-dir git reset HEAD . git reset head res/. git reset head src/. git reset head res/values/strings.xml git commit -m “your commit message.”

  8. Reverting (does the exact opposite) git revert 0da8 --no-edit git revert head --no-edit git revert head~3 --no-edit To clear all local changes since last push git reset --hard origin/master To delete a remote branch git push origin :branchName

  9. Amending: Every commit is associated with a sha-1 hash. That hash is derived from 1/ the file changes in that commit and 2/ the previous commit. You can not change any commit unless that commit is at the head. Since no other commits depend on the head, you may safely change the head. To change the head, use git commit --amend -m “your message” git commit --amend --no-edit

  10. Branching: To list the branches in a project: git branch git branch -r git branch --all To create a branch: git checkout -b branchName c39b git checkout -b branchName To delete a branch: git branch -D branchName To checkout a branch: git checkout 7afe git checkout master

  11. Pushing to remotes: To see the remotes: git remote -v show To push to a remote: git push origin master git push --all To clear all local changes since last push git reset --hard origin/master

  12. Android Studio (Vinny) Default keymap: http://android.cs.uchicago.edu/content/slides/keymap.pdf File || settings || keymap

  13. Java Review

  14. Class Objects

  15. Class Objects

  16. Spot the “class” here

  17. Java Primitives (integers)

  18. How Java Stores positive Integers -2(bits -1)to 2(bits -1)– 1 • 0001 0011 • The above is a binary representation of the number 19 stored in a byte (8 bits). • The range of a byte is: -128 to 127.

  19. Java Primitives (others)

  20. Primitives versus Objectsmemory

  21. primitive object pass by value pass by reference Action: Tell my accountant how much I intend to spend on a new car next year. Change in bank account: no change. Action: Swipe debit card and enter pin at the Bently dealership. Change in bank account: -125k.

  22. Java version versus release number 1.5 Java 5 1.6 Java 6 1.7 Java 7 mix-up between engineering and marketing at Sun (now Oracle)

  23. If a tree falls in a forest and no one is around to hear it, does it make a sound?

  24. Event-Source (Button) No Event-Listener listening Event (onClick) No Catcher No Event Listener

  25. OnClick-Listener Event-Listener listening Event-Source (Button) Event (onClick) Any Object Catcher ready to catch

  26. Wrong Event

  27. Event source not registered

  28. OnClick-Listener OnMouse-Listener Event-Listener listening Event-Source (Button) Event (onClick) Any Object Event (onMouse) Catcher ready to catch

  29. Resources in Android

  30. R.java is a table

  31. In Android, there's a res directory, which stands for resources. ldpi is 0.75x dimensions of mdpi mdpi is 1x dimensions of mdpi hdpi is 1.5x dimensions of mdpi xhdpi is 2x dimensinons of mdpi go to vidoes/resources01 time 3:50

  32. strings.xml <string name="earth">Earth</string> <string name="moon">Moon</string> <string-array name="system"> <item>@string/earth</item> <item>@string/moon</item> </string-array>

  33. colors.xml <color name="gray">#eaeaea</color> <color name="titlebackgroundcolor">#00abd7</color> <color name="titlecolor">#666666</color> <color name="opaque_red">#f00</color><color name="translucent_red">#80ff0000</color> #RGB #ARGB #RRGGBB #AARRGGBB

  34. dimens.xml <dimenname="textview_height">25dp</dimen><dimenname="textview_width">150dp</dimen><dimenname="ball_radius">30dp</dimen><dimenname="font_size">16sp</dimen>

  35. bools.xml <boolname="screen_small">true</bool><boolname="adjust_view_bounds">true</bool>

  36. dp stands for density independent pixels It's relative to a 160 dpi screen. So 1dp is one pixel on a 160dpi screen. Don't worry about calculating the dp's. Android does that for you.

  37. Add resources from the Add Resources from the graphical editor and also manually. #FFFFFF white getResources(). getStringArray(R.array.whatever)

More Related