Exam 17: Android Development: Extending Views, Fragments, and Google Maps Permissions
Exam 1: Basics of Android: Hello World23 Questions
Exam 2: Model View Controller, Gui Components, Events20 Questions
Exam 3: Coding the Gui Programmatically, Layout Managers20 Questions
Exam 4: Multiple Activities, Passing Data Between Activities, Transitions, Persistent Data22 Questions
Exam 5: Menus, Sqlite21 Questions
Exam 6: Managing the Device Orientation22 Questions
Exam 7: Touches and Swipes22 Questions
Exam 8: Graphics, Animations, Sounds and Gaming27 Questions
Exam 9: Fragments26 Questions
Exam 10: Using Libraries and Their Apis: Speech Recognition and Maps33 Questions
Exam 11: Using the Gps and Location Services21 Questions
Exam 12: Using an Existing App: Taking a Photo and Sending an Email28 Questions
Exam 13: Xml and Content Apps25 Questions
Exam 14: Making an Android Widget35 Questions
Exam 15: In App Advertising25 Questions
Exam 16: Security and Encryption23 Questions
Exam 17: Android Development: Extending Views, Fragments, and Google Maps Permissions127 Questions
Select questions type
You are coding an app with two activities, and you are coding inside the second activity, which is created from the first activity. Write one line of code to pop the current activity off the stack and go back to the first activity.
Free
(Short Answer)
4.8/5
(35)
Correct Answer:
finish( );
When using Google maps in an app, we need to include a uses-permission element in the ____________ file to specify that the app can access the current device location and a meta-data element that specifies key information.
Free
(Short Answer)
4.8/5
(36)
Correct Answer:
AndroidManifest.xml
Inside a class that extends SQLiteOpenHelper, write one statement to obtain a reference to a SQLiteDatabase.
Free
(Short Answer)
4.9/5
(40)
Correct Answer:
SQLiteDatabase db = this.getWritableDatabase( );
Assuming that we have correctly instantiated a GoogleApiClient named gac and the connection is successful, how do we retrieve the current location?
// gac is a GoogleApiClient reference; we have a connection
// Your code goes here
(Essay)
4.8/5
(36)
The ____________ method of the GestureDetector.OnDoubleTapListener is called when the user double taps the screen.
(Short Answer)
4.8/5
(34)
Inside MainActivity.java, write the code to retrieve and assign to a TextView object reference a TextView element defined in activity_main.xml and whose id is look.
(Short Answer)
4.8/5
(38)
You have created the private class BH, which implements the View.OnClickListener interface. Inside the onCreate method of the current activity, a Button b has been created. Write two lines of code to register an object of BH on the Button b.
// Button b has already been created and instantiated
(Short Answer)
4.9/5
(44)
Write a code that sets the background color of the TextView tv to red.
(Short Answer)
4.7/5
(32)
c is a Canvas reference, and p is a Paint reference. Write the code to draw a circle of radius 75 and centered at (50, 100 ) using p for the Paint parameters.
(Short Answer)
4.9/5
(37)
The ____________ class from the com.google.android.gms.ads package encapsulates a set of marketing characteristics, such as location, birthday, and keywords, so that an ad can target demographics related to the app.
(Short Answer)
4.7/5
(44)
A TextView is defined in activity_main.xml and given the id tv. Inside MainActivity.java, write the code to retrieve that TextView and change its text to CHANGED.
(Essay)
4.9/5
(44)
We have started a speech recognition activity, and the user just said a word. Assuming that the request and result codes are correct, write one statement to retrieve the list of possible matches for what the user said.
protected void onActivityResult( int requestCode,
int resultCode, Intent data ) {
// Your code goes here
(Essay)
4.9/5
(30)
We use the ____________ method of the FragmentTransaction class to add a fragment to an activity.
(Short Answer)
4.9/5
(35)
Write a code that draws a blue line that is 2 pixels thick.
< !-- blue line; your code goes here -->
(Short Answer)
4.9/5
(33)
The constant ____________ of the ViewGroup.LayoutParameters class corresponds to the value wrap_content of the android:layout_width and android:layout_height attributes.
(Short Answer)
4.7/5
(40)
The ____________ class, part of the android.media package, enables us to manage and play sounds.
(Short Answer)
4.9/5
(32)
When parsing an XML document using the DefaultHandler class, the ____________ method is called when a start tag is encountered by the parser.
(Short Answer)
4.8/5
(45)
We want to write a Bitmap named bitmap to a FileOutputStream named fos using the compress method of the Bitmap class, which has the following API:
public boolean compress( Bitmap.Compress.Format format, int quality, OutputStream stream )
The quality parameter should be between 0 and 100 (highest quality).
Bitmap.Compress.Format is an enum that includes the constants PNG and JPEG.
Write bitmap as a JPEG of the highest quality to the file represented by fos.
(Short Answer)
4.7/5
(35)
Inside activity_main.xml, write one line of code to specify that the TextView will be styled with the style named nice defined in styles.xml.
< TextView
< !--your code goes here -->
(Short Answer)
4.7/5
(39)
We can use the ____________ method of the Canvas class to draw a bitmap.
(Short Answer)
4.7/5
(37)
Showing 1 - 20 of 127
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)