Get ahead with a $300 test prep scholarship
| Enter to win by Tuesday 9/24
CS301 Final Exam - Module 4
Terms in this set (19)
Activities are rather short lived, activities are usually listed in the AndroidManifest.xml file, an activity has a rather complicated life cycle with different states that show if the activity is running or paused
These are all valid statements about Android activities
A Broadcast Receiver can have an intentfilter declared with it in the Android Manifest that helps to make sure that it only receives broadcast signals that match its specification (and thus are relevant to it), A Broadcast Receiver can be registered at runtime. Incoming intents yield a call to its onReceive method
These are all valid statements about Android broadcast receivers
For Android, it is common to program only some aspects of the user interface in Java. Other aspects, for example the appearance of an activity on screen is usually described separately and stored in an XML formatted file.
The layout of an activity is described in an XML formatted layout file. It consists of widgets and layouts that constitute the appearance of the activity. This set of entities is naturally organized as a tree.
Android has design recommendations or standards for the design of the user interface of an app. The actionbar is an example of this. The key point is to make the use of an app consistent with the use of other apps in order to establish best practices and to lower the learning curve for a user.
Programming a user interface for an Android app is different from normal Java user interface programming in these ways.
Content Provider, Broadcast Receiver, Activity, Service
These are the four different components of Android applications
An intent is called implicit intent if it does not contain the class name of the receiver such that the Android intent resolution mechanism needs to determine which object is the receiver of that intent.
The AndroidManifest file contains intent filter descriptions that help the Android OS to identify the receiver of an intent.
An intent is called explicit intent if it contains the explicit name of the class that should receive this intent.
An intent can carry additional information with a bundle that holds key-value pairs.
Android supports message passing between components within the same application or across applications.
The message is called intent in Android. The following statements are true about intents.
It shows how to start a separate activity with an implicit intent.
Explain this code snippet:
Uri uri = Uri.parse("geo:"+lat.toString()+","+lon.toString());
Intent i = newIntent(Intent.ACTION_VIEW, uri);
onResume - onPause
Android activities are subject to scheduling and the scheduler calls certain predefined methods we can use to allocate and release resources.
The location manager allows an app to obtain location information (thanks to GPS). However, this is an expensive service to operate in terms of energy consumption such that a well-behaving app should not request GPS information without using it.
Which method pair is good to allocate / release access to location information?
... an Android Content Provider
Calendar and contacts are two examples of ...
It shows how to start a separate activity with an explicit intent
Explain this code snippet:
Intent myIntent = new Intent(this, Generating.class);
The emulator operates an actual Android operating system image on top of a QEMU emulator that runs in software. This is simply a huge task to compute.
The Android emulator benefits a lot from virtualization and hardware acceleration. Why is the emulator slow?
The emulator can produce signals for incoming phone calls or text messages but does not support the actual phone calls.
The emulator can support a file system and the SQLite database but has difficulties to mimick its performance (to get the response time of the SQLite database right).
The emulator can help with different screen sizes and phone configurations (e.g. hard or soft keyboard, cpu, memory, sdcard).
The emulator can support different Android versions (API levels).
The Android emulator can emulate a real device to a certain extent. Identify correct statements about its strengths and its limitations.
Which method would you use to store your app's state when you decide that the app should backup its state when it is not longer visible on the screen (so the scheduler recognizes that some other app is in front of your app and it is not visible to the user anymore).
If I need an implicit intent.
When do you use either of the two following constructors?
Intent(String action, Uri uri)
...an Android Service.
The wall paper and the text service are two examples of...
The requestCode allows the sender of the request to match answers with corresponding questions.
Result data is communicated back with the Extras of an intent.
The resultCode communicates success or failure of the requested operation.
We can start a separate activity and do so in a way to get results back. Identify all statements that are correct.
If it is not, it should quietly return. If it is, it should delegate further processing to an activity or a service and quickly return.
What should happen in the onReceive method of a Broadcast Receiver? The code should check if the event is of interest...
Which Android component do you use to implement screens of a graphical user interface?
A Broadcast Receiver
Which component do you use in your code if your app needs to recognize that the system is low on power and will shut down?
It shows the minimum SDK version that the app requires to perform.
It lists the permissions that the app requests in order to perform.
For components such as broadcast receivers, it can list intent-filters that describe constraints to narrow the scope of events the receiver should pay attention to.
For a component like an activity, it can list action strings to describe the kind of tasks that the component can support.
It tells where to find information for a label or an icon such that Android can represent the app on a screen when offering a selection of apps to start.
Which pieces of information are revealed in the AndroidManifest file of an app?