Model solutions to Friday week 2 in class quiz, include the question and a citation where appropriate.
Re: Model solutions to Friday week 2 in class quiz
3. How is the shift to Landscape mode handled in the Android architecture, from a View, not a Controller perspective?
There is another xml file with the same name with -land added on (will be located in the layout/land folder instead of layout) that is loaded as the View for Landscape mode.
2. Give 2 reasons Resources are maintained independent of executable code in the Android architecture.
- Using independent application resources makes it easy to update various characteristics of your application without modifying code
- By providing sets of alternative resources, it enables you to optimize your application for a variety of device configurations
Source: http://developer.android.com/reference/android/content/res/Resources.html
4. What are the four steps in the onCreate method?
1) start an activity
2)gather information from a bundle
3)set the content view
4)call the parent onCreate method
5) what is the task backstack? what is the effect of the back arrow and the home key on the task backstack?
The backstack is a stack of tasks that you are accessing or previously accessed.
Pressing the back arrow takes you one task back and removes the task from the stack.
Pressing the home key pauses the task, and leaves the stack.
Page 63 and 107 in the text.
Re: Model solutions to Friday week 2 in class quiz
1) What are the other three major runnable components of an Android program (other than activities)?
Services (supports long-running/in the background apps)
Broadcast Receiver (listens for and responds to events)
Content Providers (allows multiple apps to store & share data)
Re: Model solutions to Friday week 2 in class quiz
5) What was the primary motivation for implementing the Fragment class in Android 3.0?
It was noticed by the developers that larger tablet screens had the potential to show more data than phones, yet the inflexability of the Activity class prevented showing multiple pages at the same time. Thus the Fragment was introduced to make the android interface more dynamic.