CMSC436 Exam Review Material PDF

Title CMSC436 Exam Review Material
Course Programming Handheld Systems
Institution University of Maryland
Pages 30
File Size 221.4 KB
File Type PDF
Total Downloads 54
Total Views 144

Summary

Exam Review for CMSC436...


Description

Android Platform Dev Environment

Question 1

The Android Platform comprises several components. Which of the following did I NOT say was part of the Android Platform?

Documentation Software Stack Software Developers Kit Network protocol analyzers Question 2 2. Question 2

(True or False): Android Virtual Devices can be created to mimic specific physical devices, such as a Nexus One, or a Galaxy Nexus tablet.

True False Question 3 3. Question 3

(True or False): Some Android applications depend on recent Java features, such as the try-with-resources statement. Therefore, it is important to make sure that you've installed the latest version of Java in your development environment.

True False 4. Question 4

(True or False): The Traceview tool automatically collects and displays line coverage information when you run Junit test cases on your Android applications.

True False 5. Question 5

(True or False): Android emulators can be controlled externally via a telnet session.

True False 6. Question 6

(True or False): Eclipse is the IDE of choice for Android. Other IDEs won't provide all the Android development tools that Eclipse does.

True

False 7. Question 7

Android's Linux Kernel is not exactly the same as the Linux Kernels typically running on desktop machines. Why would Android modify the Linux Kernel for Android?

To support new types of graphical user interfaces. To create competing kernel APIs. Mobile devices require features that are not usually needed on traditional desktop devices. 8. Question 8

In which of the following programming languages are Android's Native libraries typically written?

Python C/C++ Scala Java

9. Question 9

The Resource Manager helps with internationalizing applications. Which of the following might explain why that's important to Android developers?

Android phones and applications are sold to and used by people who speak languages other than English. Android applications might crash if they expected an English string, but got a Chinese character instead. US law requires English as the official language of mobile applications. 10. Question 10

Which of following kinds of information does the Location Manager provide to applications?

The direction to Earth's magnetic north. Ambient temperature. User movement. User location. 11. Question 11

Which one of the following user interface elements 1) is found in the View System and 2) was shown in the Phone application demonstrated in this week's lecture video? Note: If you want to get a peek at a bunch of Android's graphical user interface elements, see: http://developer.android.com/design/building-blocks

Tabs Notification Bars GridLists

12. Question 12

Take a look at the following website: http://developer.android.com. Which of the following statements best describes the purpose of this website?

General Android information and documentation. In-person networking. Question and answer forums. Question 13

13. Question 13

Take a look at the following website: http://stackoverflow.com/questions/tagged/android. Which of the following statements best describes the purpose of this website?

General Android information and documentation. In-person networking. Question and answer forums. Question 14

14. Question 14

Take a look at the following website: http://www.meetup.com/DC-Droids/. Which of the following statements best describes the purpose of this website?

General Android information and documentation. In-person networking. Question and answer forums. Question 15

15. Question 15

Take a look at the following website: https://groups.google.com/group/androiddevelopers. Which of the following statements best describes the purpose of this website?

General Android information and documentation. In-person networking. Question and answer forums. Question 16

16. Question 16

Take a look at the following website: http://android-developers.blogspot.com. Which of the following statements best describes the purpose of this website?

General Android information and documentation. In-person networking. Question and answer forums.

Application Fundamentals and the Activity Class

Which two of the following statements capture the main purposes of the Service class?

To enable remote (inter-process) operations. To provide an application's user interface. To manage concurrent access to shared databases. To support long-running, in the background operations.

2. Question 2

Ignoring the initial xml declaration, what is the outermost xml tag used in the AndroidManifest.xml file?

3. Question 3

How would you specify a string called "exit_message" whose value is "Goodbye", within a strings.xml file?

Goodbye text_string "Goodbye" text_string 4. Question 4

The Resource Manager helps with internationalizing applications. Which of the following might explain why that's important to Android developers?

Android applications might crash if they expected an English string, but got a Chinese character instead. Android phones and applications are sold to and used by people who speak languages other than English. US law requires English as the official language of mobile applications. 5. Question 5

Which of following kinds of information does the Location Manager provide to applications?

Ambient temperature. User location

The direction to Earth's magnetic north. User movement. 6. Question 6

Which one of the following user interface elements 1) is found in the View System and 2) was shown in the Phone application demonstrated in this week's lecture video? Note: If you want to get a peek at a bunch of Android's graphical user interface elements, see: http://developer.android.com/design/building-blocks

Tabs GridLists Notification Bars Question 7 7. Question 7

(True or False) One of the main jobs of the Activity class is to support concurrent access to shared, inter-application data.

True False (Content Providers job) 8. Question 8

The example applications for this lecture contain Activities that call setContentView(), passing in a resource ID. Which one of the following statements correctly reflects what the setContentView() method does?

It processes the underlying resource file to create Java Objects corresponding to the elements specified in the resource file. It validates the data type of the resource ID. It attaches button listeners to the code. It inserts a package in the PackageManger's database. 9. Question 9

Suppose that your application has brought ActivityA into the foreground. The user then presses a button shown by ActivityA, which causes ActivityB to be brought into the foreground, ready for user interaction. At this point, what was most likely the last lifecycle method called on ActivityA and on ActivityB?

ActivityA.onPause() and ActivityB.onRestart(). ActivityA.onStop() and ActivityB.onResume(). ActivityA.onResume() and ActivityB.onDestroy(). ActivityA.onDestroy() and ActivityB.onCreate(). 10. Question 10

Suppose you write an Activity that edits some persistent user information such as the user's account name, but does not save it immediately. This important data must be saved before the application exits. In which lifecycle method should you normally save the data?

onResume(). onStop().

onPause(). onDestroy(). 11. Question 11

Suppose you attach an OnClickListener to a Button in your Activity. When will this Object's onClick() method be called?

When the user hits the Back Key. When the user presses and releases the Button in quick succession. When the user hits the Home Key. When the user presses and holds the Button. 12. Question 12

Unless you have a strong reason for doing so, you should generally avoid handling configuration changes manually. Which one of the following statements best explains why?

It can be difficult to know and capture each configuration change that might occur. Configuration changes are not thread safe. It always takes more time to handle configuration changes manually. System reconfiguration can be checked for correctness at compile time.

13. Question 13

One example of a configuration change, is when the user changes the device's global font size. If you want to handle this configuration change manually, what value would you add to a android:configChanges attribute in the application's AndroidManifest.xml file? See: http://developer.android.com/guide/topics/manifest/activity-element.html for more information.

Intents, Permissions, and Fragments

1. Question 1

Suppose that an application includes an Activity named A, and that the application declares an tag for A within its AndroidManifest.xml file. Suppose also that Activity A should be the main entry point for this application. The application therefore specifies an tag, containing an tag. What string value should be included to complete the following tag definition - ?

2. Question 2

Suppose that an application includes an Activity named A, and that the application declares an tag for A within its AndroidManifest.xml file. Suppose also that Activity A should be the main entry point for this application and that an icon for this application/activity should appear in the top-level launcher. What string value should be used to complete the following tag - ?

Question 3 3. Question 3

The MapLocationFromContacts application created an Intent with the Action string, Intent.ACTION_PICK and a with data URI representing the contacts database. It then

started an Activity using startActivityForResult(). What type of data will the started Activity return?

Text containing Contact Data items. Images. Phone number. A String Uri. 4. Question 4

Suppose you create an application that uses the Vibration Service to make a device vibrate as a deadline approaches. To receive permission to use the Vibrator Service, you will need to add a element to your application's AndroidManifest.xml file. What string value should you use to complete the tag - ?

See: http://developer.android.com/reference/android/Manifest.permission.html for more information.

Question 5 5. Question 5

Suppose you create an application that captures and stores personal information from users, such as the medicines they are currently taking. Other applications may want to use this information and then provide add-on services over it, for example, to create 'time to take your pill' reminders. Which of the following tags would you put in your application's AndroidManifest.xml file to define a new application-specific permission for accessing your application.

. . . . Question 6 6. Question 6

(True or False) The Fragment class is a subclass of the Activity class and replaces Activities on large screen devices such as Tablets.

True. False. Question 7 7. Question 7

In which method do Fragments typically create their user interfaces?

onActivityCreated(). onAttach(). onCreate(). onCreateView().

Question 8 8. Question 8

Which of the following are good reasons for dynamically modifying application layouts at runtime, rather than by using static layout files.

Dynamically-created user interfaces can adapt to an application's runtime state, such as the amount of data that needs to be displayed at any one time. Static layouts can't take advantage of contextual information, such as the device's orientation. Dynamically-created layouts will appear on the screen and will respond noticeably faster than static layouts will. Dynamic layouts can take advantage of contextual information that's not tracked by Android's configuration system (such as current location, usage time, or ambient light measurements). Question 9 9. Question 9

Suppose you have an Activity that hosts a Fragment. This Fragment has invoked the setRetainInstance() method, passing in the parameter true. Which of the following Fragment lifecycle methods will not be called if the Activity is later killed and restarted due to a reconfiguration?

onCreate(). onDestroy(). onDestroyView().

onCreateView(). onAttach().

User Interface Classes

1. Question 1

Which of the following statements describe key responsibilities of a View?

To respond to events directed to them. To draw themselves. To contain other Views. To handle device reconfiguration. Question 2 2. Question 2

Which of the following are properties that can be set on a View?

Opacity (transparency). Screen orientation.

Visibility. Position. Question 3 3. Question 3

(True or False) - An AutoCompleteTextView is a subclass of ViewGroup. Hint: Consult the Android documentation at http://developer.android.com/reference/classes.html

True. False. Question 4 4. Question 4

Which of the following statements describe the relationship between and AdapterView and its Adapter?

Adapters can notify the AdapterView when the Adapter data changes. The Adapter asks for Views from the AdapterView. The Adapter manages a data set for the AdapterView. The AdapterView creates the Views for the data in the Adapter. Question 5 5. Question 5

Suppose a layout file declares a LinearLayout called LL that contains two child Views, View1 and View2. In the layout file View1 is given an android:layout_weight of 2 and a layout_width of 0dp. View 2 is given an android:layout_weight of 3 and a layout_width of 0dp.

In this example, which of the following statements must be true?

View 2 takes up 2/3 of the display's width. View 1 takes up 2/5 of the display's width. View 1 takes up 2/3 of LL's width. View 2 takes up 3/5 of LL's width. Question 6 6. Question 6

When a user long clicks on a View that has registered to show a Context Menu, which one of the following methods will be called?

setHasOptionsMenu(). onCreateContextMenu(). registerForContextMenu(). onContextItemSelected(). Question 7

7. Question 7

Suppose that an application wants to create and display a Dialog. If the application embodies the Dialog in a DialogFragment, which DialogFragment method will it call to make the Dialog visible to the user?

dismiss() onCreateView() show() showFragment(). Question 8 8. Question 8

The ActionBar has four functional areas: The App icon, a View control area, an Action Buttons area and an Action Overflow area. What is the purpose of the Action Overflow area? See; http://developer.android.com/design/patterns/actionbar.html for more information.

The Action Overflow area lets the user navigate back to previous points in the Task Back Stack. It is the default location for Action buttons. When Action Buttons cannot fit in or should not be placed on the Action Bar, they are displayed in a separate View that is accessible by touching the Action Overflow area. The Action Overflow area displays a drop down list for accessing commonly-used functions.

Threads, AsyncTasks and Handlers, and Networking

1. Question 1

(True or False) Java Threads running in the same Process share dynamically-allocated memory.

True. False. Question 2 2. Question 2

(True or False) Once a Java Thread is created, it typically starts running as soon as the operating system can schedule it.

True. False. Question 3 3. Question 3

If your Activity creates its user interface hierarchy during a call to its onCreate() method, how do you know in which Thread onCreate() was called? Choose the single best answer.

Examine the application's code to determine whether the call occurred in an applicationgenerated Thread or in one of the system's Threads. Examine the application's AndroidManifest.xml file. The onCreate() is always run in the UI thread. Use LogCat to print out the Thread's ID. Question 4 4. Question 4

Which of the following methods is guaranteed to run on the application's UI Thread?

Handler.sendMessage(). Activity.runOnUIThread(). View.post(). AsyncTask.doInBackground(). Question 5 5. Question 5

Which of the following statements correctly capture why an application that uses a Handler, might send Messages to the Handler, rather than post Runnables to it, or vice versa?Question text

Runnables are used when the Sender implements the action to be taken.

Messages can take parameters. Runnables can't. Messages are used when the Handler implements the Message response. Runnables are less efficient than messages. Question 6 6. Question 6

Android supports several HTTP clients. Which one of the following HTTP clients will be Android's preferred HTTP client in the future?

See http://android-developers.blogspot.com/2011/09/androids-http-clients.html for more information.

HttpURLConnection. URLStream AndroidHttpClient. DefaultHttpClient Question 7 7. Question 7

Which of the following data formats did we discuss in these lectures?

Python

KML XML JSON Question 8 8. Question 8

Which of the following statements are generally true about DOM parsers?

DOM parsers provide iterators that pull XML content into an application on demand. DOM parsers tend to use more memory than the other kinds of Parsers we discussed in this lesson. DOM parsers use a streaming model in which the parser calls back into the application when specific elements are parsed. DOM parsers convert an XML document into a tree structure, which can make it easier to do whole document analyses. Question 9 9. Question 9

The JavaScript Object Notation Language represents information using two types of data structures. Which two of the following are those data structure?

Lists Trees

Bags Maps User Notifications, Broadcast Receivers, Alarms 1. Question 1

What types of User Notifications are provided by Android?

Notification Area Notifications. Tabs. Dialogs. Fragments. Toast Messages. Question 2 1 point 2. Question 2

(True or False) Toast messages are used to get information from the user?

True.

False. Question 3 1 point 3. Question 3

Why do Notification Area Notifications use PendingIntents?

The PendingIntent can add a listener to the underlying Intent The underlying Intent has a reference to the sending component which can lead to memory leaks. To allow Extra data to be provided to the Activity that will be started. The underlying Intent will be used by the system, rather than by the component that created it. Question 4 1 point 4. Question 4

Which of the following capture why it is preferable to notify the user with a Notification Area Notification, rather than with a Dialog, or vice versa.

Use a Notification Area Notification when the user should be notified outside of any currently running application. Use a Dialog (DialogFragment) when using a large screen device such as a tablet. Use a Notification Area Notification to prevent onPause() from being called. Use a Dialog when the application needs to get user feedback. Question 5 1 point 5. Question 5

When should your application send broadcasts using the LocalBroadcastManager class, rather than by using th...


Similar Free PDFs