410 likes | 584 Views
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
E N D
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 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
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
Open each project and rename your package from jstudent to first-initial-last-name Then push your changes.
git config --global user.name "Your Name" git config --global user.email "your_email@whatever.com"
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.”
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
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
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
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
Android Studio (Vinny) Default keymap: http://android.cs.uchicago.edu/content/slides/keymap.pdf File || settings || keymap
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.
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.
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)
If a tree falls in a forest and no one is around to hear it, does it make a sound?
Event-Source (Button) No Event-Listener listening Event (onClick) No Catcher No Event Listener
OnClick-Listener Event-Listener listening Event-Source (Button) Event (onClick) Any Object Catcher ready to catch
OnClick-Listener OnMouse-Listener Event-Listener listening Event-Source (Button) Event (onClick) Any Object Event (onMouse) Catcher ready to catch
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
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>
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
dimens.xml <dimenname="textview_height">25dp</dimen><dimenname="textview_width">150dp</dimen><dimenname="ball_radius">30dp</dimen><dimenname="font_size">16sp</dimen>
bools.xml <boolname="screen_small">true</bool><boolname="adjust_view_bounds">true</bool>
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.
Add resources from the Add Resources from the graphical editor and also manually. #FFFFFF white getResources(). getStringArray(R.array.whatever)