móviles programacion dam
DESCRIPTION
programación DAM movilesTRANSCRIPT
1
Móviles U2
What is the name of the folder that contains the R.java file? Select one:
a. src
b. bin
c. res
d. gen Feedback
The correct answer is: gen
Question 2
Match:
ListView Answer 1
Displays a scrolling single column list
GridView Answer 2
Displays a scrolling grid of columns and row s
LinearLayout Answer 3
Organizes its children into a single horizontal or vertical row
The correct answer is: ListView
– Displays a scrolling single column list, GridView
– Displays a scrolling grid of columns and rows, LinearLayout
– Organizes its children into a single horizontal or vertical row
Question 3
Which layout is designed to block out an area on the screen to display a single item? Select one:
a. TableLayout
b. FrameLayout
c. LinearLayout
d. RelativeLayout The correct answer is: FrameLayout
Question 4
2
Which of these is correct about XML layout files? Select one:
a. Layout information written in the XML layout file will be converted into code by the Android platform when the screen is displayed.
b. There is no distinction between implementation of the layout definition by code or by XML layout file
c. In an Eclipse project using the ADT plugin, the XML layout file is found in the /res/layout
directory
d. In order to display an UI defined in the XML layout file "main.xml", call the setContentView method of the Activity with the parameter string "main.xml" Feedback
The correct answer is: In an Eclipse project using the ADT plugin, the XML layout file is found in the /res/layout directory
Question 5
You can populate an AdapterView such as ListView or GridView by binding the AdapterView instance to an Adapter, which retrieves data from an external source and creates a View that represents each data entry.
Select one:
True
False
The correct answer is 'True'.
Question 6
The ___________ specifies the layout of your screen
Select one:
a. R file
b. Manifest file
c. Layout file
d. Strings XML
The correct answer is: Layout file
Question 7
3
Which is the correct explanation of ListView?
Select one:
a. When displaying a list of Strings using an ArrayAdapter class in ListView, you must save
the value in an ArrayList
b. You cannot use a ListView when there is no information to be displayed
c. ListView has a function to display a list of uniquely defined Views other than TextView
d. It is necessary to use ListView as a set with ListActivity
The correct answer is: ListView has a function to display a list of uniquely defined Views other
than TextView
Question 8
Which one is not a nickname of a version of Android?
Select one:
a. Honeycomb
b. Cupcake
c. Gingerbread
d. Muffin
The correct answer is: Muffin
Question 9
The Android Software Development Kit (SDK) is all you need to develop applications for
Android
Select one:
a. False
b. True
The correct answer is: True
Question 10
4
A fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running.
Select one:
True
False
The correct answer is 'True'.
Question 11
The plus(+) means in statement android:id="@+id/my_id"?
Select one:
a. XML parser should parse and expand id string
b. Create new id and add to resources
c. Identify it as an id resource
d. Both a & b
The correct answer is: Create new id and add to resources
Question 12
Complete:
public static class ExampleFragment extends Fragment {
@Override public View _____________ (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate (R.layout.example_fragment, container, false);
}
}
Select one:
a. onPause
5
b. onCreateView
c. onCreate
d. onView
The correct answer is: onCreateView
Question 13
Which is wrong?
Select one:
a. Each layout file must contain exactly two root elements
b. After you've declared your layout in XML, save the file with the .xml extension
c. A layout defines the visual structure for a user interface
d. The advantage to declaring your UI in XML is that it enables you to better separate the
presentation of your application from the code that controls its behavior
The correct answer is: Each layout file must contain exactly two root elements
Question 14
The R file is a(an) __________ generated file
Select one:
a. Manually
b. Automatically
c. Emulated
d. None of the above
The correct answer is: Automatically
Question 15
What operating system is used as the base of the Android stack?
6
Select one:
a. Linux
b. Java
c. XML
d. Windows
The correct answer is: Linux
Question 16
To create an emulator, you need an AVD. What does it stand for? Select one:
a. Android Virtual Device
b. Android Virtual Display
c. Application Virtual Display
d. Active Virtual Device The correct answer is: Android Virtual Device
Question 17
Match:
Toggle Buttons
Answer 1Allow the user to change a setting betw een tw o states
Text Fields Answer 2Allow the user to type text into the app
Chechboxes Answer 3Allow the user to select one or more options from a set
Radio Buttons Answer 4Allow the user to select one option from a set
The correct answer is: Toggle Buttons
– Allow the user to change a setting between two states, Text Fields
7
– Allow the user to type text into the app, Chechboxes
– Allow the user to select one or more options from a set, Radio Buttons
– Allow the user to select one option from a set
Question 18
What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?
Select one:
a. findViewById (String id)
b. findViewByReference (int id)
c. retrieveResourceById (int id)
d. findViewById (int id) The correct answer is: findViewById (int id)
Question 19
Where the positions of the children can be described in relation to each other or to the parent? Select one:
a. LinearLayout
b. TableLayout
c. FrameLayout
d. RelativeLayout Feedback
The correct answer is: RelativeLayout
Question 20
An activity can be thought of as corresponding to what? Select one:
a. An object field
b. A Java class
c. A Java project
d. A method call
The correct answer is: A Java class
8
Moviles U3
Question 1
An activity can be thought of as corresponding to what?
Select one:
A Java class
A method call
An object field
A Jave project
The correct answer is: A Java class
Question 2
Which of the following is not an activity state?
Select one:
Stopped
Paused
Running
Resumed
The correct answer is: Resumed
Question 3
What does the following code achive?
Intent intent = new Intent(Activity1.this, Activity2.class);
startActivityForResult(intent);
Select one:
Starts a browser activity
9
Starts a sub-activity
Starts an activity service
Send results to another activity
The correct answer is: Starts a sub-activity
Question 4
The activity lifecycle method onPause() is called when the activity becomes visible to the user.
Select one:
True
False
The correct answer is 'False'.
Question 5
What does the following code achive?
Intent intent = new Intent(Activity1.this, Activity2.class);
Select one:
Creates an hidden Intent
Creates an implicit Intent
Creates an explicit Intent
Starts an activity
The correct answer is: Creates an explicit Intent
Question 6
Implicit intents explicitly define the component which should be called by the Android system, by using the Java class as identifier.
Select one:
10
True
False
The correct answer is 'False'.
Question 7
The activity lifecycle method onResume() is called if the activity get visible again and the user starts interacting with the activity again.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 8
What does the following code?
Bundle extras = getIntent().getExtras();
String dato1 = extras.getString("dato1");
int dato2 = extras.getInt("dato2");
Select one:
Nothing
Return data
Recover the data that has been passed to the activity
Send data to an activity
The correct answer is: Recover the data that has been passed to the activity
11
Question 9
Android supports:
Select one:
Explicit intents
Implicit intents
Explicit and implicit intents
The correct answer is: Explicit and implicit intents
Question 10
The activity lifecycle method onCreate() is called when the activity is first created.
Select one:
True
False
The correct answer is 'True'.
Question 11
Android system uses intents to
Select one:
To invoke other applications from your application
Broadcast system intents
Broadcast custom intents
All of the above
The correct answer is: All of the above
12
Question 12
What does the following code?
Intent intent = new Intent();
intent.putExtra("dato1", "Esto es un ejemplo");
setResult(RESULT_OK, intent);
Select one:
Read the information received from another activity
Return data to the activity that has called us
Send information to another activity without waiting for an answer
Send data to another activity waiting for an answer
The correct answer is: Return data to the activity that has called us
Question 13
What is contained within the manifest xml file?
Select one:
All other choices
The permissions the app requires
The list of strings used in the app
The source code
The correct answer is: The permissions the app requires
Question 14
Intents are asynchronous messages which allow application components to request functionality from others Android components.
Select one:
13
True
False
The correct answer is 'True'.
Question 15
During an Activity lifetime, what is the first method callback invoked by the system?
Select one:
onRestore()
onStop()
onStart()
onCreate()
Feedback
The correct answer is: onCreate()
Question 16
What does the following code?
Intent intent = new Intent(this, Activity2.class);
intent.putExtra("dato1", "Esto es un ejemplo");
startActivity(intent);
Select one:
Return the data to Activity2
Send information to Activity2 without waiting for an answer
Send data to Activity2 waiting for an answer
Read the information received from Activity2
The correct answer is: Send information to Activity2 without waiting for an answer
14
Question 17
Once ____________ has finished, Android will call onStart()
Select one:
onPause()
onBegin()
onResume()
onCreate()
The correct answer is: onCreate()
Question 18
Optionally an intent can also contain additional data based on an instance of the Bundle class which can be retrieved from the intend via the getExtras() method.
Select one:
True
False
Feedback
The correct answer is 'True'.
Question 19
If the Android system needs to terminate processes it follows a priority system. Match each
process status with its priority:
Empty Answer 1
5
Service Answer 2
3
15
Background Answer 3
4
Foreground Answer 4
1
Visible Answer 5
2
Feedback
The correct answer is: Empty – 5, Service – 3, Background – 4, Foreground – 1, Visible – 2
Question 20
Match the following buttons of an Android device with its function:
Home button Answer 1
Android place the activity into the background
Power button Answer 2
Lock the screen
Back button Answer 3
Android w ill kill the activity
Feedback
The correct answer is: Home button – Android place the activity into the background, Power
button – Lock the screen, Back button – Android will kill the activity
Moviles U4
Question 1
The database tables should use the identifier _id for the primary key of the table
Select one:
True
False
The correct answer is 'True'.
16
Question 2
What is the life cycle of a content provider?
Select one:
All the content providers will be created (onCreate()) after phone has booted first time
A content provider's onCreate() function will be called the first time some client calls
providers functions using content resolver
None
A content provider's onCreate() function will be called every time some client calls providers
functions using content resolver
The correct answer is: A content provider's onCreate() function will be called the first time some
client calls providers functions using content resolver
Question 3
Correct
Is it possible to start a content provider using an intent?
Select one:
Yes, it's possible. Content provider is also a component of Android, so we can use intent to
start it
It's not possible. We use content resolver to communicate with content provider
The correct answer is: It's not possible. We use content resolver to communicate with content
provider
Question 4
A content provider is typically used to share data with other applications.
Select one:
True
False
The correct answer is 'True'.
17
Question 5
Does getWriteableDatabase() always call onCreate() of SQLiteOpenHelper class?
Select one:
Only if the database is not created
Yes, it does
None of the above
Every time that the user starts the application
The correct answer is: Only if the database is not created
Question 6
A SQLite database is private to the application which creates it.
Select one:
True
False
The correct answer is 'True'.
Question 7
What does the following code?
ContentValues values = new ContentValues();
values.put ("name", "Pepe");
db.insert ("myTable", null, values);
Select one:
Nothing
Inserts two new rows into "myTable"
Deletes a row
18
Inserts a new row into "myTable" where "name" is "Pepe"
The correct answer is: Inserts a new row into "myTable" where "name" is "Pepe"
Question 8
Is it possible to pass a lower version number to upgrade a SQLite database?
Select one:
Yes, it's possible
None of the above
Helper class will assume that we will always pass version numbers in incremental order for
upgrading
It's not necessary to pass any value, system will automatically generate higher version
number
The correct answer is: Helper class will assume that we will always pass version numbers in
incremental order for upgrading
Question 9
The SQLiteOpenHelper class
Select one:
doesn't allow upgrade a database
allow access to data stored in a database
allow create and upgrade a database
All options are true
The correct answer is: allow create and upgrade a database
Question 10
How to upgrade database tables?
Select one:
Pass different version number in incremental order and put all upgrading code in
onCreate() of SQLiteOpenHelper class
19
Pass different version number in any order and put all upgrading code in onUpgrade() of
SQLiteOpenHelper class
Pass different version number in decremental order and put all upgrading code in
onUpgrade() of SQLiteOpenHelper class
Pass different version number in incremental order and put all upgrading code in
onUpgrade() of SQLiteOpenHelper class
The correct answer is: Pass different version number in incremental order and put all upgrading
code in onUpgrade() of SQLiteOpenHelper class
Question 11
Which methods of the SQLiteOpenHelper class get access to an SQLiteDatabase object?
Select one:
getAccessDatabase()
getWriteDatabase()
getReadDatabase()
getReadableDatabase() and getWriteableDatabase()
The correct answer is: getReadableDatabase() and getWriteableDatabase()
Question 12
How to share daba between two applications?
Select one:
sqlite database
content resolver
content provider
file
The correct answer is: content provider
20
Question 13
Where does the SQLite database of an Android application get stored?
Select one:
By default it's stored in internal memory, but it is also possible to store it in sd card.
On sd card
On network server
Internal memory
The correct answer is: By default it's stored in internal memory, but it is also possible to store it
in sd card.
Question 14
What is the difference between contentprovider and contentresolver?
Select one:
They are not related with each other
Content provider is used to share private data with other applications and content resolver
is used to communicate with content provider from client application
Content provider is used to store private data and content resolver is used to communicate
with content provider from client application
Content resolver is used to share private data with other applications and content provider
is used to communicate with content provider from client application
The correct answer is: Content provider is used to share private data with other applications and
content resolver is used to communicate with content provider from client application
Question 15
A Cursor represents the result of a query and basically points to one row of the query result.
Select one:
True
False
The correct answer is 'True'.
21
Question 16
Which option is true?
Select one:
SQLite requires limited memory at runtime
All options are true
SQLite supports standard standard database features
SQLite is an Open Source database
The correct answer is: All options are true
Question 17
What does a query return?
Select one:
A cursor object
A file
A data
An array
The correct answer is: A cursor object
Question 18
Which is the base class for working with a SQLite database in Android?
Select one:
SQLiteDatabase
Database
SQLiteData
22
SQLiteTable
The correct answer is: SQLiteDatabase
Question 19
What does the following code?
return datablase.query ("myTable", null, null, null, null, null, null);
Select one:
Returns the first row of "myTable"
Returns the selected row of "myTable"
Returns all data stored in "myTable"
Nothing
The correct answer is: Returns all data stored in "myTable"
Question 20
What does the following code?
return datablase.query ("myTable", null, null, null, null, null, "field1");
Select one:
Returns only the data of the column "field1"
Returns the selected row
Returns all data stored in "myTable" ordered by "field1"
Nothing
The correct answer is: Returns all data stored in "myTable" ordered by "field1"