answers 2024
Is the following XML tag legal syntax: "<button> Hello world </button>"
Yes
No - ANSWERSNo
Which was the first smartphone available that ran Android?
Nexus one
Motorola Droid
HTC Dream - ANSWERSHTC Dream
What operating system is Android based on?
Linux
Unix
Windows - ANSWERSLinux
Is the following XML code legal syntax:
"<list><item>item 1</item> <item /> </list>"
Yes
No - ANSWERSYes
Does Android version 4.4 (KitKat) natively support Fragments (not using the support
library)?
Yes
No
Unknown - ANSWERSYes
Does Android version 2.2 (Froyo) natively support Fragments (not using the support
library)?
Yes
No
Unknown - ANSWERSNo
Is the following XML tag legal syntax: "<ul><li>Bananas <li> apples </ul>"
Yes
No - ANSWERSNo
Which folder would contain the resource: "R.layout.first_page"
res
layout
res/layout - ANSWERSres/layout
Which folder would contain the resource: "R.drawable.a_picture"
,res/layout
res/drawable
res/pictures - ANSWERSres/drawable
Which folder would contain the strings.xml file for the German language? values-de
values-ge
values - ANSWERSvalues-de
Which file specifies the starting Activity for an application?
manifest.xml
app_config.xml
AndroidManifest.xml - ANSWERSAndroidManifest.xml
When compiling your Android project, which gets compiled first?
Java Files
XML files - ANSWERSXML files
Which function gets called first in the Android Lifecycle:
onStart
onCreate
onResume - ANSWERSonCreate
Which function gets called last in the Android Lifecycle:
onPause
onStop
onDestroy - ANSWERSonDestroy
When is the bundle parameter for the onCreate(Bundle savedInstance) null?
When the application is loaded for the first time
When onSaveInstance was called previously - ANSWERSWhen the application is
loaded for the first time
If the bundle parameter for the onCreate(Bundle savedInstance) is not null, which
function gets called automatically?
onRestoreInstanceState(Bundle savedInstanceState) onSaveInstanceState(Bundle
outState) - ANSWERSonRestoreInstanceState(Bundle savedInstanceState)
What does the first parameter in getSharedPreferences("a_string",
Context.MODE_PRIVATE)?
The string to retrieve
The file name
The string to save - ANSWERSThe file name
When you call putString("string_one", "string_two"), which string that represents the
value (not name)?
"string_one"
, "string_two"
Unknown - ANSWERS"string_two"
Which function must you call to retrieve the saved string from the sharedPreferences
call:
putString("string_one", "string_two")
getString("string_one", "string_three")
getString("string_two", "string_three") - ANSWERSgetString("string_one",
"string_three")
Which function must you call to start an activity when you want to get data back?
startActivity()
startActivityForData()
startActivityForResult() - ANSWERSstartActivityForResult()
What function must you call to end an Activity?
endActivity()
finish()
finishActivity() - ANSWERSfinish()
If you call setResult(Activity.RESULT_OK), what will be the value of the request code
parameter in onActivityResult(int request, int result, Intent data)?
RESULT_OK
5
Unknown - ANSWERSUnknown
What is the proper format for creating a Toast message?
Toast.makeText(getApplicationContext(), "The message", Toast.LENGTH_SHORT);
Toast.makeText("The message", getApplicationContext(), Toast.LENGTH_SHORT);
Toast.makeText(Toast.LENGTH_SHORT, "The message", getApplicationContext()); -
ANSWERSToast.makeText(getApplicationContext(), "The message",
Toast.LENGTH_SHORT);
What design pattern is used when chaining many function calls for creating an
AlertDialog:
dialog.setMessage().setTitle().setPositiveButton().setNegativeButton().show();? The
alert pattern
The builder pattern
The command pattern - ANSWERSThe builder pattern
Which Log function should I call to show warning information?
Log.d()
Log.i()
Log.w() - ANSWERSLog.w()
Which of the following functions is required for implementing the ListAdapter interface?