Test
Android
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (80)
1Within an XML file that defined styles, a property of a style is specified by a/an _________
- Astyle element
- Bapplication element
- Citem element
- Dtheme element
2The ________ file uses its application element to specify the theme for the application.
- Astyles.xml
- BAndroidManifest.xml
- Ccolors.xml
- Dtheme.xml
3If a device doesn't have a physical menu button a/an ______ is displayed on the right side of the action bar to display the options menu.
- AOptions menu
- BFloating context menu
- CPopup Menu
- DAction overflow icon
4To define names for colors, you typically add a/an _______ file to the res/values directory.
- Astyles.xml
- Bcolors.xml
- CAndroidManifest.xml
- Dtheme.xml
5In Android Studio, to view the XML for the layout, click the ______ tab.
- AText
- BAndroid
- CDesign
- DTerminal
6Although Android supports other units of measurement, it's a best practice to use
- Ainches
- Bems
- Cmillimeters
- Ddensity-independent pixels (dp)
7Three common types of widgets are
- ATextView, Button, EditText
- BTextView, Input, EditText
- CTextView, DPad, EditText
- DEditText, Button, DPad
8Which of the following is not a common property for layouts?
- Apadding
- Bmethod
- Cwidth
- Dheight
9The lifecycle methods of a fragment are ______ to the lifecycle methods of an activity
- Asimilar
- Bvery different
- Cidentical
- Dopposite
10An activity can include a/an _____ that includes one or more ___________
- Amenu item, options menus
- Bpopup menu, options menus
- Coptions menu, menu items
- Doptions menu, popup menus
11When an activity is started, Android runs which method?
- AonStop
- BonPause
- ConCreate
- DonCreateOptionsMenu
12Typically, an event occurs when a user interacts with a/an
- Awire
- Blistener
- Cevent handler
- Dwidget
13An object that listens for an event is known as a/an
- Aevent handler
- Blistener
- Caction key
- Devent
14For most widgets, you can use which method(s) to get and set the text that's displayed on the widget?
- AcalculateAndDisplay
- BtoString and fromString
- CgetText and setText
- DtoWidget and toDisplay
15The Click event is available from most widgets, but most _____ handle this event with an attribute in the XML declaration of the widget.
- Atext views
- Beditable text views
- Clabels
- Dbuttons
16When an activity is in the paused state, the activity
- Ais visible and has the focus
- Bhas lost the focus and may be partially hidden by other activities
- Chas lost the focus and is completely hidden by another activity
- Dhas the focus but is completely hidden by another activity
17An Android _____ widget allows the user to select an item from a list of items
- Aspinner
- Bcheckbox
- Ctoast
- Dimage button
18What is the latest version of Android?
- AOreo
- BPie
- CNougat
- DMarshmellow
19When an app starts for the first time, Android calls the
- AonCreate, onRestart and onStop methods
- BonCreate, onPause, and onDestroy methods
- ConCreate, onStart and onResume methods
- DonStart, onPause and onStop methods
20The Android Debug Bridge (ADB)
- ALets your IDE communicate with an emulator or physical Android device
- Ballows you to enter and edit the source code
- Ccompiles the source code
- Dnone of the above
21In which Android Stuio folder do the files strings.xml, styles.xml and colors.xml reside?
- Alayout
- Bvalues
- Cdrawable
- Dxml
22Given an EditText widget named usernameEditText, which of the following statements gets the string that's stored in that widget?
- AString username = (String) usernameEditText;
- BString username = usernameEditText.toString();
- CString username = usernameEditText.getText();
- DString username = usernameEditText.getText().toString();
23What does the following code do?
ArrayList<HashMap<String, String>> info = new ArrayList<HashMap<String, String>>();
for (Books book: books) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("title", book.getTitle());
map.put("author", book.getAuthor());
map.put("price", book.getPrice());
info.add(map);
}- AIt creates an adapter named info
- BIt creates an adapter named map
- CIt creates a variable named info that stores data
- DIt creates a variable named map that stores the info for an adapter
24An Android Virtual Device (AVD) is an
- Aintegrated development environment
- Bemulator
- Cdebug bridge
- Dchild element
25Which of the following statements displays a message on the user interface that says, "Hello"?
- AToast.makeText("Hello", Toast.LENGTH_SHORT);
- BToast.makeText("Hello", Toast.LENGTH_SHORT).show();
- CToast.makeText(this, "Hello", Toast.LENGTH_SHORT);
- DToast.makeText(this, "Hello", Toast.LENGTH_SHORT).show();
26In a linear layout, the _________ attribute determines how much space Android allocates to a widget.
- Agravity
- Borientation
- Cweight
- Dlinear
27Which of the following statements selects the second item in the spinner?
- AmonthsSpinner.select(1);
- BmonthsSpinner.select(2)
- CmonthsSpinner.setSelection(2)
- DmonthsSpinner.setSelection(1)
28Which of the following gets the current value of the Seek Bar named volumeSeekBar?
- Aint volume = volumeSeekBar.getProgress();
- Bint volume = volumeSeekBar.progress;
- Cint volume = volumeSeekBar.getValue();
- Dint volume = volumeSeekBar.value;
29When a user presses a hardware button on a device, a _____ event occurs.
- AKey
- BPress
- CSystemService
- DMotion
30For a Seek Bar, the ______ method is executed as the user changes the value of the seek bar.
- AonStartTrackingTouch
- BonStopTrackingTouch
- ConProgressChagned
- Dnone of the above
31In a table layout, which attribute can you add to have a widget span two columns?
- Aandroid:span="2"
- Bandroid:widget_span="2"
- Candroid:col_span="2"
- Dandroid:layout_span="2"
32A/an _____ lets the user select one option from several options.
- Aeditable text view
- Btext view
- Cradio button
- Dcheck box
33Which of the following is not true about creating a device definition for an emulator?
- AYou can specify the device's serial number.
- BYou can specify whether the device provides hardware buttons.
- CYou can specify the screen size the resolution.
- DYou can specify the Android API for the device.
34For the textSize property, it's generally considered a best practice to use ________ to specify the size of the text.
- Amillimeters
- Binches
- Cems
- Dscale-independent pixels
35Given the following code in the strings.xml file, which of the following properties sets the text on the widget to "Continue"?
<string name="continue">Continue</string>- Aandroid:text="@string/name"
- Bandroid:textStyle="@string/name"
- Candroid:text="@string/continue"
- Dandroid:textStyle="@string/continue"
36Android doesn't always save the data of an activity when you
- AClick a button
- BChange orientation
- CEnter data into an EditText widget
- Dmake a selection from the Spinner widget
37<TextView
android:id="@+id/billAmountLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/bill_amount_label"
android:textSize="20sp"
android:textStyle="bold" />
Which of the following statements gets a reference to the widget?- ATextView billAmountTextView = findView(R.id.billAmountTextView);
- BTextView billAmountLabel = findViewById(R.id.billAmountLabel);
- CTextView billAmountLabel = findViewId(R.id.billAmountLabel);
- DTextView billAmountTextView = findViewById(TextView);
38<TextView
android:id="@+id/billAmountLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="@string/bill_amount_label"
android:textSize="20sp"
android:textStyle="bold" />
How much height is allocated to the widget?- A20sp
- B10dp
- CJust enough height to display the widget
- DEnough height to match the parent container
- E30dp
39In Android Studio, when you run an app with the debugger, and it encounters a breakpoint, Android Studio
- Astops before it executes the line of code at that breakpoint
- Bcontinues to the end of the current method
- Cdisplays the Breakpoint window
- Dstops at the first line of code in the first activity
40In a linear layout, which attribute can you add to switch to horizontal orientation?
- Aandroid:weight="horizontal"
- Bandroid:orientation="horizontal"
- Candroid:gravity="horizontal"
- Dandroid:layout="horizontal"
41Within a <style> element in styles.xml, which of the following elements would set the text size of the style to 15sp?
- A<item textSize="15sp">
- B<item name="android:textSize">15sp</item>
- C<item name="textSize"15sp</item>
- D<property name="textSize">15sp</property>
42What type of content can a WebView widget display?
- AOnly XML
- BOnly HTML and CSS
- COnly HTML, CSS and JavaScript
- DAny type of content that a web browser can display
43Refer to the following code:
if(helloCheckBox.isChecked()) {
helloTextView.setVisibility(View.GONE);
} else {
helloTextView.setVisibility(View.VISIBLE);
}
Given a text view named helloTextView, what does this code do if the checkbox named helloCheckBox is checked?- AIt makes the text view visible.
- BIt hides the text in the text view.
- CIt hides the text view.
- DIt makes the text in the text view visible.
44Given this image: res/drawable-midpi/jack_of_spades.png
Which imageView attribute specifies the location of the image?- Aandroid:src="@drawable/jack_of_spades.png"
- Bandroid:src="@drawable/jack_of_spades"
- Candroid:src="@drawable-mdpi/jack_of_spades.png"
- Dandroid:src="@drawable-mdpi/jack_of_spades"
45A/an _______ is a collection of styles that apply to an entire activity or app.
- Astyle sheet
- Btheme
- Cproperty
- Dmipmap
46What directory is used to store the XML for a menu?
- Ares\menu
- Bres\layout
- Cres\values
- Dres\xml
47To determine which widget an event occurred on, you use the _____ method of the View class.
- ACheckChanged
- BonClick
- CgetID
- DgetEvent
48A/an _____ is a collection of properties that specify formatting for a widget.
- Atheme
- Bproperty
- Cmipmap
- Dstyle
49@Override
public void onCheckedChanged(CompoundButton widget, boolean isChecked) {
deleteOldMessages = isChecked;
}
Assuming this method is wired to a CheckBox widget, what happens when the user checks that box?- AThe deleteOldMessages variable is set to true.
- BThe deleteOldMessages variable is set to false.
- CThe deleteOldMessages variable is not changed.
- DA runtime exception is thrown.
50@Override
public void onCheckedChanged(CompoundButton widget, boolean isChecked) {
deleteOldMessages = isChecked;
}
If you decided to wire this event handler to multiple check boxes, which switch statement could you add to this method to compare the ID of the check box that was changed with the IDs of the check boxes on the layout?- Aswitch(view.getId()) {...}
- Bswitch(widget.getId()) {...}
- Cswitch(isChecked) {...}
- Dswitch(checkedid) {...}
51Which of the following attributes sets the style for the widget to the spinner style?
- Astyle="@android:style/Spinner"
- Bstyle="@style/Spinner"
- Candroid:style="@style/Spinner"
- Dandroid:style="Spinner"
52@Override
public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
month = 0;
}
Assume that this method is wired to a Spinner widget that displays the 12 month names in order (January, February, March, etc.). How can you change the statement in this method so that the month variable is 1 for January, 2 for February, 3 for March, etc.?- Amonth = position + 1;
- Bmonth = parent.getPosition();
- Cmonth = parent.getPosition() + 1;
- Dmonth = position;
53An Android activity can include a/an ______ that displays the activity's title and, optionally, buttons that perform actions.
- Aproperties bar
- Btitle bar
- Cstyle bar
- Daction bar
54Which is false about a fragment?
- AIt's a class that you can use to define part of the user interface.
- BIt can be reused in multiple activities.
- CIt can also be referred to as a pane.
- DIt cannot contain Android widgets.
55What does the following statement do?
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));- AIt starts the activity that is defined by the class named SettingsActivity
- BIt starts the activity that is defined by the class named Intent.
- CIt creates a menu item for the class named SettingsActivity.
- DThis statement won't compile because it uses the wrong number of parameters.
56<style name="TextView">
<item name="android:textSize">20sp</item>
</style>
<style name="Button" parent="@style/TextView">
<item name="android:textStyle">bold</item>
</style>
<style name="PrimaryButton" parent="@style/Button">
<item name="android:textColor">@color/primary</item>
</style>
The style named PrimaryButton inherits...- Athe Button style
- BtheTextView style
- Cthe Button style and the TextView style
- DNo styles
57<style name="TextView">
<item name="android:textSize">20sp</item>
</style>
<style name="Button" parent="@style/TextView">
<item name="android:textStyle">bold</item>
</style>
<style name="PrimaryButton" parent="@style/Button">
<item name="android:textColor">@color/primary</item>
</style>
Within the colors.xml file for the project, which of the following elements defines the color for the text of the PrimaryButton style?- A<color name="primary">#141315</color>
- B<item name="textColor">#141315</color>
- C<color style="PrimaryButton">@android:blue</color>
- D<color name="primaryColor">@android:blue</color>
58_______ is the deployment file created by Android Studio that gets deployed to a device.
- AZIP file
- BAPK file
- CJAR file
- DOBJ file
59The __________ is a super class of all widgets.
- AWidget
- BTextView
- CPlaceholder
- DView
60When you add a default empty activity (eg. MainActivity) in Android Studio, it extends from the _________ base class.
- AAppCompatActivity
- BActivity
- CFragment
- DAndroid
61_______ is an XML file that specifies the launcher activity for your Android application.
- Astrings.xml
- BAndroid.xml
- CAndroidManifest.xml
- DApplication.xml
62_______ is the activity callback method that is called just before the activity comes to the foreground.
- AonContinue
- BonResume
- ConRestore
- DonDemand
63At this time, what is the most commonly used version of Android?
- ALollipop
- BMarshmellow
- COreo
- DNougat
64When coding the class for a fragment, what class do you typically extend?
- AActivity
- BPane
- CFragment
- DPreferenceScreen
65By default, if you specify an icon for an item, Android uses that icon in the _____, but it uses text for that item in the _____.
- Aoptions menu, action bar
- Baction bar, options menu
- Cpopup menu, action bar
- Dpopup menu, options menu
66You cannot use a FragmentManager object (returned by getFragmentManager()) to
- Aget a reference to a Fragment object
- Breplace one fragment with another fragment
- Cget a reference to the containing activity
- Dcreate transactions
67Which of the following menu item attributes displays the icon for the menu bar only when there's enough room in the action bar to fit the icon?
- Aandroid:icon="ifRoom"
- Bandroid:icon="showAsAction"
- Candroid:showAsAction="icon"
- Dandroid:showAsAction="ifRoom"
68Which method do you typically override to handle the event that occurs when a user selects an item from the options menu?
- AonCreateOptionsMenu
- BonPrepareOptionsMenu
- ConOptionsItemSelected
- DonOptionsItemClick
69To add more than one fragment to a layout, add two more more _____ to a layout file.
- Aname elements
- Bfragment elements
- Cfragment classes
- Dnone of the above
70For an asynchronous task, within the inner class, you can access the context for the activity by coding
- Athe name of the outer class
- Ba period
- Cthe this keyword
- Dthe name of the outer class, a period, and the this keyword
71<fragment android:name="ca.bcit.newsreader.ItemsFragment"
android:id="@+id/items_fragment"
android:layout_weight="1"
android:layout_width:0dp"
android:layout_height="match_parent" />
Which of the following are false about this code?- AIt displays the fragment defined by the ItemsFragment class
- BThe fragment is hidden because it has zero width
- CIt sizes the fragment so it's as tall as the parent container
- DThis fragment has an ID of items_fragment
72The AsyncTask class provides for these generic types:
- AParams, Progress, Result
- BAsync, Task
- CTimerTask, URL, String
- DURL, Context
73Which method is executed when the user selects one of the items in the ListView widget?
- AonCreateView
- BOnDestroy
- ConItemClick
- DonItem
74A/an ______ intent specifies the action you want to perform and can be used to view a URL in a web browser or to call a phone number.
- Aexplicit
- Bdaemon
- Ccomplacent
- Dimplicit
75There are three steps to handling an event. First, import the interface that defines a listener. Second, implement the listener. Third...
- AUse the Project window to connect the listener
- BEdit the strings.xml file
- CDrag the listener onto the graphical layout editor
- DWire the listener to an event
76In Android Studio, to view the layout in the graphical editor, click the _____ tab.
- AText
- BAndroid
- CDesign
- DTerminal
77Which of the following declares a class for an asynchronous thread?
- Aclass GetItems extends AsyncTask{}
- Bclass GetItems extends Timer{}
- Cclass GetItems extends Timer<String, Void, String> {}
- Dclass GetItems extends AsyncTask<String, Void, String>{}
78Within a class for an asynchronous thread, which of the following methods is executed on the asynchronous thread?
- AonPreExecute()
- BdoInBackground(Params...)
- ConProgressUpdate(Progress...)
- DonPostExecute(Result)
79Within a class for an asynchronous thread which of the following methods is executed on the UI thread after the asynchronous thread has finished executing?
- AonPostExecute(Result)
- BonPreExecute()
- CdoInBackground(Params...)
- DonProgressUpdate(Progress...)
80In an activity, which of the following statements can you use to get the intent that started the activity and retrieve a string named title that has been stored in that intent?
- AIntent intent = getIntent(); String title = intent.getTitle();
- BIntent intent = getIntent(); String title = intent.getStringExtra("title");
- CIntent intent = new Intent(); String title = intent.getTitle();
- DIntent intent = new Intent(); String title = intent.getStringExtra("title");
Información
- Descripción
- Computer Science Test sobre Android, creado por t t el 22/02/2019.
- Autor
- t t
- Idioma
- English
- Visitas
- 41
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test