Download presentation
Presentation is loading. Please wait.
Published byΛεωνίδας Κουβέλης Modified over 5 years ago
1
Lecture 4 agenda Event Handling Fragments The Freemason Conspiracy
Scenes and Animations ListViews and Adapters More Reminders From the book: 20, 24-27, 28-30 1
2
Serializable versus Parcelable
Parcelable is an Interface very much like Serializable only it has been optimized for Android. Unlike Serializeable, all the reflection meta-data has been stripped-out of the parcelized object.
3
Intents Intent messaging is a facility for late run-time binding between components in the same or different applications. Intents are handled by the Android OS. In order for the OS to know about a component, it must be declared in the application manifest file. If a component does not define Intent filters, it can only be called by explicit Intents. A component with filters can receive both explicit and implicit intents. 6/12/12
4
AndroidManifest.xml file
Is an inventory of all the components in an application. If the component is not listed there, the Android OS won't know it's there. Not even intra-app component communication will resolve. 6/12/12
5
Android OS I AndroidManifest.xml AndroidManifest.xml *A A A *A
Activies, Receivers, Services, and Content-Providers all must be declared in the manifest. Intnets are calls to the op-system. It handles all intents, explicit and implicit.
6
ListViews and Adapters
6
7
Adapters 7
8
AdapterViews 8
9
FreeMasons were a very powerful guild of stone masons
FreeMasons were a very powerful guild of stone masons. The reason they call them FreeMasons is because their skills were so valuable in the middle ages that they were not subject to any soveriegn King. They were free to travel wherever they need cathedrals built. They had the equivalent of an H1B-Visa, but even more powerful.
10
Trace their craft back to the architect of solomons' temple
Trace their craft back to the architect of solomons' temple. A guy named Hyrim Abiff.
11
The thing about building with stone is that it's a very heavy material and therefore forces you to build in a particular way. This is rockafeller chapel and you will notice that aside from an occassional gargoyle, this structure is get's lighter as you rise in elevation and the pieces get smaller. If it were the other-way around, the building would collapse. If you're a stone-mason, you mus build in blocks and pyramids.
13
When new materials such as iron beams and rebar reinforced concrete came on the scene, the FreeMasons were horrified and they put a curse on all the engineering disciplines, that said, you can only build with blocks and pyramids.
14
These kind of cantilevered structures scared them the most because clearly this would put an end to their stone mason craft.
15
The freemasons were a powerful bunch
The freemasons were a powerful bunch. A lot of the founding fathers were freemasons. They could get away with this. Fortunately, all the other engienering disciplines recovered from this hex, except for computer science, and therefore we are condemned to build in blocks and pyramids forever.
16
He approves. So he clearly approves of this lovely pyramid here.
18
Resources in Android 18
20
Layouts and resources Code: Java (or C if you use NDK) Metafiles: AndroidManifest, project.properties, .gitignore. These all describe the project. Resources “anything in android that is not code or metafiles” Activities have one or more layouts, and all Layouts have a root-ViewGroup. This root-ViewGroup is the container for the Views. R.java (gen directory) is a bridge between your resources and your code. If you want to interact programmatically with a resource, it must have an id.
22
Inspecting layouts and resources
You can view both xml and design mode in AS. You can see how it would look on multiple devices || preview all screens, and toggle with remove previews.
23
Layouts and resources res directories can have suffixes, such as layout-land, or drawable-hdpi, values-es, etc. These suffixes allow you to differentiate at RUNTIME depending on the settings, hardware, and configuration of the device. For example, if your device is in landscape mode, it'll try to fetch the layout from layout-land first, then it will try to fetch the layout from layout. Vice versa as well; if it's in portait mode, it'll try for layout-port, then layout. shown in preview mode of resource and rotate device
24
Lifecycle in Android 24
28
how to copy files from a bc branch to a lb branch
Actions || Open in Terminal git checkout c7c7 res/drawable-*/. git checkout c7c7 res/values/str* before a commit you may remove from stage, then: discard: for existing files that you want to roll back remove: for new files that you want to delete
29
ADB (Android Device Bridge)
adb kill-server adb start-server adb get-state adb devices Use kill-server / start-server to reboot the adb if your device/emulator is not communicating with your dev-machine.
30
Navigating in Android Studio
alt-1 is project view (alt-F1 is show it in project view) alt-2 is favorites (including bookmarks and breakpoints) alt-3 is the search view (cntl-shift-F to find) alt-4 run-console alt-5 is debug alt-6 is android view (ddms, logcat) alt-7 is structure view (see members and methods) alt-9 is changes(VCS) view Look at the margin of your project
31
Get help cntl-shift-A (find anything in Android studio) Searching (on mac, replace cntrl with command) cntl-F (find something in the local file) cntl-shift-F (find something in the project) Go to file in code (on mac, replace cntrl with command) cntl-N (go to files typically in src) cntl-shift-n (go to any file, including res) cntl-E (open recent files) Go to file in project alt-F1
32
Go to definition cntl-B (go directly to the method definition) Javadocs cntl-Q (open the javadocs) Live Templates cntl-J adding your own Live Templates (cntl-shift-A “live template”)
33
Debugging Using the debugger (alt-5) See bookmarks and breakpoints (alt-2) F11 to toggle bookmark Using logcat (alt-6) Using lint and AS analyzer: Analyze || Inspect Code ///TODO this is my todo message
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.