0% found this document useful (0 votes)
23 views41 pages

Exercises

The document consists of a series of questions and answers related to Android application development, covering components like Activity, permissions, and the Android Runtime. It discusses the use of Java, the Dalvik Virtual Machine, and various UI elements such as buttons and menus. Additionally, it addresses concepts like the AndroidManifest.xml file and the EditText component for user input.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views41 pages

Exercises

The document consists of a series of questions and answers related to Android application development, covering components like Activity, permissions, and the Android Runtime. It discusses the use of Java, the Dalvik Virtual Machine, and various UI elements such as buttons and menus. Additionally, it addresses concepts like the AndroidManifest.xml file and the EditText component for user input.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1a Correct1.0/1.

0
Question

It is considered the base component of an Android application. Therefore, it is the most


used.
It consists of a UI (User Interface) manager class. It represents a
unique user screen.
Both the application flow and screen events are your responsibility.

The definition above corresponds to the component:

Content Provider
Intent
Activity
Service
Broadcast Receiver
Responded on 04/15/2020 [Link]

2a Agreement:1.0/1.0
Question

Do you already know that the Java language is used to build applications for the
Android. The fact is that in its operating system there is no Java virtual machine.
In fact, what we have is a virtual machine called ____ that is optimized for
execution on mobile devices. ¿LECHETA, Ricardo Google Android p 26 The name
the virtual machine for Android that completes the above sentence is:

DALVIK
APK
AVD
KVM
JVM
Answered on 04/15/2020 [Link]

3a Correct:1.0/1.0
Question

In the development of some mobile applications and their use of resources


Native operating system configurations and permissions for their use are necessary.
resources. Which configuration file should we change to grant these permissions?
Manifest file
Property file
Java source file
R file
Layout file
Replied on 04/15/2020 [Link]
4a Correct:1.0/1.0
Question

In building screens on Android, it is common to use the View component of type BUTTON.
to process the data provided by the user. So that this component can process the
user click action he must implement:
implement a onMouseClickListener component
implement an OnClickListener
implement an OnItemClickListener
implement a ButtonClickListener
implement a ButtonClick type component
Responded on 04/15/2020 [Link]

5a Correct:1.0/1.0
Question

Regarding menus, it is correct to state that:

They are an extremely used and easy to implement resource, which is why the
their usability and appearance are not important criteria.
A popup menu supports icons.
The Android system provides only two types of menus: context menu and
menu pop-up.
A context menu is displayed when the user clicks and holds for more than 2
seconds, a visual component.
A popup menu supports nested submenus.
Responded on 04/15/2020 [Link]

6a Correct:1.0/1.0
Question

The AlertDialog class can display a dialog box with a title and up to three buttons.
Differently from the Toast class, we can interact with the user through the
button pressing. Indicate the method of this class that defines a button that does not
cancels and does not confirm an action.

setMessageButton
setPositiveButton
setNeutralButton
setTitleButton
setNegativeButton
Responded on 04/15/2020 [Link]

7a Correct:1.0/1.0
Question
Just like the dimensions, we can also define the color directly in our
properties or, as recommended, in a file called [Link]. The standard
RGB (Red/Green/Blue) is used to define colors on Android screens. Mark the
correct alternative that defines the color green:

#00gg00
#00ff00
#ff0000
#0000ff
#gg0000
Answered on 04/15/2020 [Link]

8a Agreement:1.0/1.0
Question

To work with databases on Android, it is necessary that


let's have a class that inherits from the class

SQLite
SQLiteOpenHelper
Context
FormBdListener
FormOpenHelper
Answered on 04/15/2020 [Link]

9a Correct:1.0/1.0
Question

Android allows data manipulation with SQLite, without the need for
use SQL instructions during communication with the DBMS. For this we can
encapsulate the operations of insertion (insert), update (update), and deletion (delete)
through the methods of the class?

SQLiteStatement
SQLiteOpenHelper
SQLiteContentValues
SQLiteDatabase
ContentValues
Answered on 04/15/2020 [Link]

10a Correct:1.0/1.0
Question

The format most commonly used in web services responses, due to its simplicity in
comparison with XML.

The above definition refers to:


HTTP
CGC
JSON
URL
PYTHON

1aQuestion

What is the name of the class used by the intent to store additional information?

DataStore

Extra

Bundle

Activity

Parcelable

Responded on 04/02/2020 [Link]

2aQuestion

Just like in the Java language, the Android platform has its own virtual machine, called
Dalvik Virtual Machine (DVM).

Optimized to consume less memory, it differs from the Java Virtual Machine (JVM) because the files
.class files are converted to the .dex (Dalvik Executable) format, which corresponds to the Android application.
compiled and compressed into a file with the .apk (Android Package File) extension that represents the
final application.

Starting from Android 4.4, the DVM was replaced by:

DVK

JIT

JDK

APK

ART

Answered on 04/02/2020 [Link]

Explanation:

Starting from Android 4.4, the DVM was replaced by the Android Runtime (ART) which offers improved performance.
much superior in relation to the DVM. One of the main differences between the DVM and the ART is the way of
compilation.

In DVM, the compilation process is based on JIT (Just in time). In ART, it is fully compiled.
in the app installation and this happens only once. As a result, the code is much faster in its
execution because it does not need to be compiled many times. Additionally, because it requires fewer resources
CPU consumes less battery.
3aQuestion

Mobile devices have their own characteristics that require changes in the way of
software development for them. Which of the characteristics below does NOT correspond to this
type of device?

Greater battery autonomy.

They are usually faster to start up or shut down.

They are smaller and lighter.

They use the mouse as a pointing device.

They can have connectivity, including intermittent.

Answered on 04/02/2020 [Link] PM

4aQuestion

Select the option that is not a mobile device:

Tablet

Ultrabook

Desktop

Notebook

Smartphone

Answered on 04/02/2020 [Link] PM

5aQuestion

Complete the sentence: Mobile technology and the _________________ are part of our
Everyday. They allow access to data at any time and place. Evolution tends to make them a part of
our body.

Activity

onReset

Smart TV

Mobile Devices

Computers

Responded on 04/02/2020 [Link] PM

6aQuestion
It is considered the basic component of an Android application. That's why it is the most used.
It consists of a UI (User Interface) manager class. It represents a single user screen.
Both the application flow and screen events are your responsibility.

The definition above corresponds to the component:

Activity

Broadcast Receiver

Content Provider

Service

Intent

Responded on 04/02/2020 [Link] PM

Explanation:

The Activity is considered the base component of an Android application. Therefore, it is the most used.
It consists of a UI (User Interface) management class. It represents a single user screen.
Both the flow of the application and screen events are your responsibility. This does not mean that all
The application needs to have a user interface, but if it does, it will require at least one Activity.

1aQuestion

What is the name of the class used by the intent to store additional information?

Bundle

Activity

Extra

DataStore

Parcelable

Answered on 04/02/2020 [Link] PM

2aQuestion

Just like in the Java language, the Android platform has its own virtual machine, called
Dalvik Virtual Machine (DVM).

Optimized to consume less memory, it differs from the Java Virtual Machine (JVM) because the files
.class files are converted to the .dex (Dalvik Executable) format, which corresponds to the Android application
compiled, and compressed into a file with the .apk extension (Android Package File) that represents the
final application.

Starting from Android 4.4, the DVM was replaced by:

JDK

ART

DVK

APK
JIT

Responded on 04/02/2020 [Link] PM

Explanation:

Starting from Android 4.4, the DVM was replaced by the Android Runtime (ART) which offers improved performance.
much superior to DVM. One of the main differences between DVM and ART is the way of
compilation.

In the DVM, the compilation process is based on JIT (Just in Time). In ART, it is fully compiled.
in the application installation and this happens only once. As a result, the code is much faster in its
execution because it does not need to be compiled many times. Furthermore, it requires fewer resources
CPU consumes less battery.

3aQuestion

Mobile devices have their own characteristics that require changes in the way of
software development for them. Which of the characteristics below does NOT correspond to this.
type of device?
They are smaller and lighter.

They are usually faster for startup or shutdown.

They can have connectivity, including intermittent.

Greater battery autonomy.

They use the mouse as a pointing device.

Responded on 04/02/2020 [Link] PM

4aQuestion

Mark the option that is not a mobile device:

Ultrabook

Desktop

Smartphone

Tablet

Notebook

Responded on 02/04/2020 [Link]

5aQuestion

Complete the sentence: Mobile technology and the _________________ are part of our
everyday. They allow access to data anytime and anywhere. Evolution tends to make them a part of
our body.
onReset

Computers

Mobile Devices

Smart TV

Activity

Responded on 04/02/2020 [Link] PM

6aQuestion

It is considered the foundational component of an Android application. Therefore, it is the most used.
It consists of a UI (User Interface) manager class. It represents a single user screen.
Both the application flow and screen events are your responsibility.

The above definition corresponds to the component:

Broadcast Receiver

Service

Activity

Intent

Content Provider

1aQuestion

It is considered the base component of an Android application. For this reason, it is the most used.
It consists of a UI (User Interface) manager class. It represents a single user screen.
Both the application flow and screen events are your responsibility.

The above definition corresponds to the component:

Content Provider

Intent

Service

Activity

Broadcast Receiver

Answered on 04/15/2020 [Link]

Explanation:

The Activity is considered the basic component of an Android application. Therefore, it is the most used.
It consists of a UI (User Interface) manager class. It represents a single user screen.
Both the application flow and screen events are your responsibility. This does not mean that every
the application needs to have a user interface, but if it does, it will need at least one Activity.
2aQuestion

Mark the option that is not a mobile device:

Tablet

Ultrabook

Smartphone

Desktop

Notebook

Answered on 04/15/2020 [Link]

3aQuestion

Mobile devices have their own characteristics that require changes in the way of
software development for them. Which of the characteristics below does NOT correspond to this
type of device?

They are usually faster to start up or shut down.

They use the mouse as a pointing device.

They can have connectivity, including intermittent.

Greater battery autonomy.

They are smaller and lighter.

Answered on 04/15/2020 [Link]

4aQuestion

Complete the sentence: Mobile technology and the _________________ are part of our
daily. They allow access to data anytime and anywhere. Evolution tends to make them a part of
our body.

Activity

Computers

Smart TV

onReset

Mobile Devices

Responded on 04/15/2020 [Link]

5aQuestion

The main programming language used for construction of


Applications for the Android Platform use the Java language. One of the steps
The preparation of the environment is the configuration of a 'variable of
environment", which will be used by the development environment to
access the libraries available on the Java platform. According to the
material, what is this environment variable and for which directory is it
point?
JAVA_JDK - adding the installation path of NetBeans
JAVA_NETBEANS - adding the installation path of
NetBeans
JAVA_HOME - adding the installation path of the JRE
JAVA_JDK - adding the installation path of Eclipse
JAVA_ECLIPSE - adding the installation path of Eclipse

1aQuestion

In an Android project, there are some files that play an important role in the definition and
project configuration. Mark the option that correctly indicates the name of the file whose description is
presented below:

Considered one of the main files of its application. It is in it that essential information is described.
to the execution of your project such as, for example:
Package name used;
Name of Activities;
Permissions that the app has;
Minimum version of the Android API.

Activity_main.xml

[Link]

Content_main.xml

[Link]

[Link]

Answered on 04/15/2020 [Link] PM

Explanation:

Every application must have an [Link] file (precisely with that name) in the directory.
root. The manifest file provides essential information about the application to the Android system,
necessary for the system before it can execute the application code. Among other things, the
the manifesto file contains:

Package name used;


Name of the Activities;
Permissions that the application has;
Minimum API version for Android.

2aQuestion

Regarding development for the Android platform, it is correct to state:

There is no need to worry about configuring the version of the target platform (for example,
Android 2.3.3) during the setup of an AVD, as this is done automatically by Dalvik.
NDA.

An AVD is a virtual Android device that can emulate real devices, however, only the
smartphones can be emulated.
Events are generated only by users or by other applications.

To test their applications, the Android developer can use either an AVD or a
smartphone real.
Answered on 04/15/2020 [Link]

3aQuestion

Among the components we use to create an application on Android, there is one that allows for
text input. This component is known as:

TextField

Teat Area

EditText

Label

TextBox

Answered on 04/15/2020 [Link]

Explanation:

This component is known as EditText

4aQuestion

Among the components we use to create an application on Android is the one that allows the
multiple exclusion among your options. This component is known as:

CheckBox

TextView

Radio Button

Button

EditText

Responded on 04/15/2020 [Link]

Explanation:

This component is the RadioButton

5aQuestion
Do you already know that the Java language is used to build applications for Android? The fact is that
there is no Java virtual machine in your operating system. In fact, what we have is a machine
virtual call ____that is optimized for execution on mobile devices.¿ LECHETA, Ricardo Google
The name of the virtual machine for Android that completes the above sentence is:

AVD

KVM

DALVIK

APK

JVM

Answered on 04/15/2020 [Link]

6aQuestion

The Activity is responsible for building a screen in Android, as well as handling the events generated by it.
Every Android application must implement at least one Activity, which can call other Activities.
Android is responsible for managing the lifecycle of Activities.

Below is the description of one of the methods used in the management of an Activity's lifecycle:

It is the first function executed when the Activity is created. It is responsible for loading the layouts.
XML, initializing objects, variables, and other initialization operations. It is important to remember that
executed only once.

Select the option that indicates the method whose execution corresponds to the description above.

onInitialize()

onRestart()

onCreate()

onResume()

onStart()

1aQuestion

Among the components we use to create an application on Android, there is one that allows for
multi-exclusion among your options. This component is known as:

Button

EditText

CheckBox

RadioButton

TextView

Responded on 04/15/2020 [Link]

Explanation:

This component is the RadioButton.


2aQuestion

Among the components we use to create an application on Android, there is one that allows the
text input. This component is known as:

Label

EditText

Teat Area

TextField

TextBox

Responded on 04/15/2020 [Link]

Explanation:

This component is known as EditText

3aQuestion

Regarding development for the Android platform, it is correct to state:

There is no need to worry about configuring the target platform version (for example,
Android 2.3.3) during the setup of an AVD, as this is done automatically by Dalvik.
NDA.

An AVD is a virtual Android device that can emulate real devices, however, only the
smartphones can be emulated.
To test their applications, the Android developer can use either an AVD or a
real smartphone.
Events are generated only by users or by other applications.

Answered on 04/15/2020 [Link]

4aQuestion

The Activity is responsible for building a screen in Android, as well as handling the events generated by it.
Every Android application must implement at least one Activity, which can call other Activities. The
Android is responsible for managing the lifecycle of Activities.

Below is the description of one of the methods used in the management of an Activity's life cycle:

It is the first function executed when the Activity is created. It is responsible for loading the layouts.
XML, initializing objects, variables, and other initialization operations. It is important to remember that
executed only once.

Choose the option that indicates the method whose execution corresponds to the description above.
onInitialize()

onResume()

onCreate()

onRestart()

onStart()

Answered on 04/15/2020 [Link]

Explanation:

The onCreate() method is the first to be called, and it is executed only once, for each Activity. It has
for the purpose of loading XML layouts, initializing objects, variables, and performing other operations
initialization.

5aQuestion

Do you already know that the Java language is used to build applications for Android. The fact is that
there is no Java virtual machine in your operating system. In fact, what we have is a machine
virtual call ____that is optimized for execution on mobile devices.
Android page 26 The name of the virtual machine for Android that completes the sentence above is:

AVD

APK

KVM

JVM

DALVIK

Answered on 04/15/2020 [Link]

6aQuestion

In an Android project, there are some files that play an important role in the definition and
project configuration. Select the option that correctly indicates the name of the file whose description is
presented below:

Considered one of the main files of its application. It is here that essential information is described.
in the execution of your project such as, for example:
Package name used;
Activity Names;
Permissions that the application has;
Minimum version of the Android API.

[Link]

Activity_main.xml

[Link]

Content_main.xml

[Link]
1aQuestion

Regarding the XML layout file, what is the correct statement?

Responsible for generating unique IDs for the components

It corresponds to a PNG image layout file

A file that contains a single activity widget

A file that contains all the application's permission information

It is used to draw the content of an activity.

Answered on 04/15/2020 [Link]

2aQuestion

An Activity class on the Android platform represents:

An encapsulated class with getters and setters

A screen of the mobile application

An object of type button.

A utility class

An XML configuration file

Responded on 04/15/2020 [Link]

3aQuestion

Regarding the structure of an Android application, it is correct to say:

The AndroidManifest file is mandatory in an Android application.

The R class is an optional file in an Android application.

NDA.

The R Class can only be altered if such permission is configured in Eclipse.

An Activity can only contain Views, as Viewgroups are not allowed.

Answered on 04/15/2020 [Link]

4aQuestion

Consider the statement:


A component of the Android application framework allows applications to access data from others.
applications or to share your own data.
Which of the alternatives is completely true?

Activity Manager
Content Provider

Activity

Notification Manager

Resource Manager

Answered on 04/15/2020 [Link]

5aQuestion

An Android platform project has a configuration file where permissions are defined.
of the application and its activities. The name of this file is:

[Link]

Activity

[Link]

Manifest file - [Link]

File R

Answered on 04/15/2020 [Link]

6aQuestion

The VIEW type components are intended for building the graphical user interface, being composed of
of user interaction components and screen organization components. Which of the following
Components do not belong to the category of screen organization components?

RadioGroup

LinearLayout

GridView

ScrollView

FrameLayout

Answered on 04/15/2020 [Link]

7aQuestion

In the development of some mobile applications and in their use of native system resources
Operational, it is necessary to configure and release the use of these resources. Which configuration file
Should we change to allow these permissions?

Java source file

Property file

Layout file

R file
Manifest file

Answered on 04/15/2020 [Link]

8aQuestion

Android provides a number of View components used in building the graphical user interface.
These components are called widgets. Mark the option that identifies only components.
of this type

TextView, EditText, Button.

ScrollView, GridView, EditText.

Button, RelativeLayout, GridView.

TableLayout, ScrollView, Button.

TextView, LinearLayout, RadioButton.

1aQuestion

The __________ component has as its main objective the execution of background tasks.

In Android applications, a _____________ is used to represent a user interface screen with the
user.

The ___________ is the mechanism used to make the application data available to others.
applications on the device.

The ____________ component is used in the communication process for receiving messages.
sent by the Android operating system to the applications.

A - Activity
B - Broadcast Receiver
C - Content Provider
D - Service

Choose the correct option:

D - A - B - C

A - B - C - D

D - A - C - B

C - D - A - B

B - C - D - A

Answered on 04/15/2020 [Link]

2aQuestion

In the development of some mobile applications and their use of native system resources
Operationally, it is necessary to configure and authorize the use of these resources. Which configuration file
Should we change to release these permissions?
Manifest file

Layout file

Java source file

Property file

R file

Responded on 04/15/2020 [Link]

3aQuestion

VIEW type components are intended for building the user interface, being composed of
of user interaction components and screen organization components. Which of the following
Do components not belong to the category of screen organization components?

ScrollView

FrameLayout

LinearLayout

GridView

RadioGroup

Answered on 04/15/2020 [Link]

4aQuestion

Consider the statement:


A component of the Android application framework allows applications to access data from others.
apps or to share your own data.
Which of the alternatives is completely true?

Activity Manager

Activity

Resource Manager

Content Provider

Notification Manager

Answered on 04/15/2020 [Link]

5aQuestion

About the structure of an Android application, it is correct to say:

An Activity can contain only Views, while Viewgroups are not allowed.

NDA.

The R class is an optional file in an Android application.


The R Class can only be altered if such permission is configured in Eclipse.

The AndroidManifest file is mandatory in an Android application.

Responded on 04/15/2020 [Link]

6aQuestion

An Android platform project has a configuration file where permissions are defined.
of the application and its activities. The name of this file is:

Manifest file - [Link]

[Link]

Activity

File R

[Link]

Answered on 04/15/2020 [Link]

7aQuestion

An Activity class on the Android platform represents:

An object of type button.

A screen of the mobile application

An encapsulated class with getters and setters

A utility class

A configuration XML file

Answered on 04/15/2020 [Link]

8aQuestion

About the XML layout file, what is the correct sentence?

Responsible for generating unique IDs for the components

A file that contains a single activity widget

It corresponds to a PNG image layout file.

It is used to draw the content of an activity

A file that contains all the application's permission information

1aQuestion
In building screens on Android, it is common to use the View component of type BUTTON to handle the
data provided by the user. For this component to handle the user's click action, it must
implement

implement a ButtonClick type component

implement an OnClickListener

implement an onMouseClickListener component

implement a ButtonClickListener

implement an OnItemClickListener

Answered on 04/15/2020 [Link]

2aQuestion

About components for screen construction, list the items below according to the table of
VIEW components and check the correct option

( ) Organizes the UI components of a screen


( ) Allows grouping of single selection items on a screen
LinearLayout Allows defining a single choice option on a screen
( 2 ) TextView ( ) Allows presenting information in a
( 3 ) Checkbox ( ) Allows choosing between two states in a
( 4 ) Radiobutton
( 5 ) Radiogroup

( ) 1, 5, 4, 2, 3

( ) 1, 5, 3, 2, 4

( ) 5, 1, 2, 4, 3

( ) 3, 4, 1, 5, 2

( ) 4, 3, 2, 1, 5

Responded on 04/15/2020 [Link]

3aQuestion

What happens with the execution of the code below: Button button = (Button)findViewById([Link]);
Good
Day student!" ,Toast.LENGTH_LONG).show(); } });

An AlertDialog is displayed.

The findViewById command is used to search for the object of the Activity class.

A popup appears on the screen with the message ¿ctx¿.

The code only works if it is outside the onCreate method.

The message Good morning student is displayed when the button is clicked on a Toast.

Answered on 04/15/2020 [Link]


4aQuestion

To handle Button events, the method we must override is:

ItemListener

OnClickListener

ChangeItemClick

Event on Click

OnItemClickListener

Answered on 04/15/2020 [Link]

5aQuestion

It is incorrect to state that about ScrollView components:

The scroll bars will be automatically inserted when the View exceeds the size of the
physical cloth.
It is necessary to insert a ViewGroup within the ScrollView that will be responsible for holding all the
other components.
They hinder the display of different components on a screen.

This class can only have one child component.

Allow scroll bars to be displayed automatically in case of being


necessary to display different components on the same screen.
Responded on 04/15/2020 [Link]

Explanation:

It is very common for app screens to have many components, making it difficult to display them all in
a single screen. That's why the ScrollView component allows for scroll bars to be presented
automatically, if necessary for displaying all components on the same screen.

6aQuestion

To build a Screen in Android, three elements are necessary (mentioned below). According to
the responsibility of each one, make the association below.
Java Class
( ) Contains a list of constants used to access project resources.
manages the activity life cycle.
Your data cannot be changed.
( ) Contains the specification of how the activity will be presented. Mark the item that contains the sequence
correct from top to bottom association:

3,2,3,1.

2,2,3,1.

2,1,3,2.

2,1,2,3.

1,2,3,1.

Responded on 04/15/2020 [Link]


7aQuestion

In Android window programming, one must consider the event handling:

Events are generated by the user, by the OS, or by another application.


(II) on an Android screen, events can be generated by the view Button.
(III) An activity must contain the code to handle events generated in the window by user interaction.

Mark the option that identifies the correct statements:

III, only.

I, II and III.

I, only.

II, just.

II and III only.

1aQuestion

To build a Screen in Android, three elements are required (mentioned below). According to
the responsibility of each one, make the association below.
Java Class
( ) Contains a list of constants used to access project resources.
Manages the life cycle of the activity.
Your data cannot be changed.
( ) Contains the specification of how the activity will be presented. Mark the item that contains the sequence
correct from the association top down:

2,1,2,3.

3,2,3,1.

2,2,3,1.

1,2,3,1.

2,1,3,2.

Answered on 04/15/2020 [Link]

2aQuestion

Regarding components for screen construction, list the items below according to the table of
VIEW components and check the correct option

Organizes the UI components of a screen


( ) Allows grouping of single selection items on a screen
LinearLayout ( ) Allows defining a single choice option on a screen
( 2 ) TextView ( ) Allows to present information in a
( 3 ) Checkbox ( ) Allows you to choose between two states in a
(4) Radiobutton
Radiogroup

( ) 5, 1, 2, 4, 3
( ) 4, 3, 2, 1, 5

( ) 3, 4, 1, 5, 2

( ) 1, 5, 4, 2, 3

( ) 1, 5, 3, 2, 4

Answered on 04/15/2020 [Link]

3aQuestion

In order to handle Button events, the method we need to override is:

EventonClick

OnClickListener

Change Item Click

ItemListener

OnItemClickListener

Answered on 04/15/2020 [Link]

4aQuestion

It is incorrect to state that about ScrollView components:


It is necessary to insert a ViewGroup inside the ScrollView that will be responsible for containing all the
other components.
Allows scroll bars to be displayed automatically in case of being
necessary to display different components on the same screen.
They hinder the display of the different components on a screen.

This class can only have one child component.

Scroll bars will be automatically inserted when the View exceeds the size of the
physical cloth.
Answered on 04/15/2020 [Link]

Explanation:

It is very common for app screens to have many components, making it difficult to display all of them on
a single screen. Therefore, the ScrollView component allows scroll bars to be presented.
automatically, if needed for displaying all components on the same screen.

5aQuestion

In building screens on Android, it is common to use the BUTTON type View component to handle the
data provided by the user. For this component to handle the user's click action it must
implement

implement an OnClickListener
implement a ButtonClickListener

implement an OnItemClickListener

implement an onMouseClickListener component

implement a ButtonClick type component

Answered on 04/15/2020 [Link]

6aQuestion

What happens with the execution of the code below: Button button = (Button)findViewById([Link]);
Good
Good day student!
The message Good morning student is displayed when the button is clicked in a Toast.

The findViewById command is used to search for the object of the Activity class.

An AlertDialog is displayed.

The code only works if it is outside the onCreate method.

A popup is displayed on the screen with the message ¿ctx¿.

Responded on 04/15/2020 [Link]

7aQuestion

In Android window programming, one must consider event handling:

Events are generated by the user, by the OS, or by another application.


(II) an Android screen, events can be generated by the view Button.
(III) An activity must contain the code to handle events generated in the window by user interaction.

Select the option that identifies the correct statements:

II and III, only.

I, II and III.

II, just.

I, just.

III, just.

1aQuestion

Through the makeText() method of the Toast class, we can, among other things, set the time for
duration of message display. The use of the constant Toast.LENGTH_LONG corresponds to a
duration of:

6 seconds.

3 seconds
4 seconds

8 seconds

2 seconds

Answered on 04/15/2020 [Link]

Explanation:

The makeText method of the Toast class can be configured regarding the display time of the
message, based on the following constants:

Toast.LENGTH_LONG - 4 seconds;
Toast.LENGTH_SHORT - 2 seconds.

2aQuestion

Android has user notification components to display warning messages. Select the option
that represents a component that displays an alert dialog window to the user

Frame

AlertDialog

DialogFrame

Toast

LinearLayout

Answered on 04/15/2020 [Link]

3aQuestion

It is correct to say about menus that:

The Android system provides only two types of menus: context menu and pop-up menu.

A popup menu supports icons.

They are an extremely used resource and easy to implement, hence their usability and
their appearance is not an important criterion.
A context menu is displayed when the user clicks and holds for more than 2 seconds on a
visual component.
A popup menu supports nested submenus.

Answered on 04/15/2020 [Link]

Explanation:

A context menu is displayed when the user clicks and holds down on a component for more than 2 seconds.
visual.

Menus, being common, require that their usability and appearance are
questions need special attention.
The Android system provides only 3 types of menus.

A popup menu does not support icons.

A popup menu does not support nested submenus.

4aQuestion

Given the following Android code snippet below:

EditText edt = (EditText) findViewById([Link].edittext1);


[Link]("message");

Select the option that correctly explains the code:

Instantiate a viewgroup component from its definition in a layout file and


assign a text that will be displayed on the screen.
Declare a widget type component and assign a text that will be displayed on the screen.

Instantiates a view component of type EditText and displays it on the screen

Declare a viewgroup type component and assign a text that will be displayed on the screen.

Instantiates a widget type component from its definition in a layout file and assigns
a text that will be displayed on the screen.

Responded on 04/15/2020 [Link]

5aQuestion

In an Android application, the android:showAsAction parameter defines how to display the


components. Indicate which of the constants below should be used when one wishes that the
component should be displayed in the 'action bar'

NEVER

ALWAYS

WITHTEXT

COLLAPSE ACTION VIEW

IFROOM

1aQuestion

It is correct to say that about menus:

A context menu is displayed when the user clicks and holds for more than 2 seconds on a
visual component.
A popup menu supports icons.

A popup menu supports nested submenus.

They are an extremely used resource and easy to implement, hence their usability and
their appearance is not an important criterion.
The Android system provides only two types of menus: context menu and pop-up menu.
Answered on 04/15/2020 [Link]

Explanation:

A context menu is displayed when the user clicks and holds a component for more than 2 seconds.
visual.

Menus, because they are common, require that their usability and appearance be
questions require special attention.

The Android system provides only 3 types of menus.

A popup menu does not support icons.

A popup menu does not support nested submenus.

2aQuestion

In an Android application, the parameter android:showAsAction defines how to display the


components. Indicate which of the constants below should be used when one wishes that the
component should be displayed in the "action bar"

IFROOM

NEVER

COLLAPSE ACTION VIEW

ALWAYS

WITHTEXT

Answered on 04/15/2020 [Link]

Explanation:

The constant IFROOM is used for configuring the android:showAsAction parameter when it
wants the component to be displayed in the action bar, if there is space.

Its use is appropriate for maintaining compatibility with various types of devices and also with screens.
vertically or horizontally.

3aQuestion

Through the makeText() method of the Toast class, we can, among other things, configure the duration of
duration of the display of a message. The use of the constant Toast.LENGTH_LONG corresponds to a
duration of:

6 seconds.

2 seconds

4 seconds

8 seconds

3 seconds
Answered on 04/15/2020 [Link]

Explanation:

The makeText method of the Toast class can be configured in terms of display time.
message, based on the following constants:

Toast.LENGTH_LONG - 4 seconds;
Toast.LENGTH_SHORT - 2 seconds.

4aQuestion

Android has user notification components to display warning messages. Select the option
that represents a component that displays an alert dialog window to the user

DialogFrame

LinearLayout

Frame

Toast

AlertDialog

Responded on 04/15/2020 [Link]

5aQuestion

Given the following Android code snippet below:

EditText edt = (EditText) findViewById([Link].edittext1);


[Link]("message");

Mark the option that correctly explains the code:

Instantiates a widget type component from its definition in a layout file and assigns it
a text that will be displayed on the screen.

Declare a widget-type component and assign a text that will be displayed on the screen.

Instantiate a viewgroup component from its definition in a layout file and


Assign a text that will be displayed on the screen.
Instantiate a view component of type EditText and display it on the screen

Declare a viewgroup type component and assign a text that will be displayed on the screen.

How should a ProgressDialog be configured to represent the progress of a measurable and finite task?

We should use setProgressDialog with the value STYLE_HORIZONTAL.

We should use setMax with the value STYLE_SPINNER.

We must use setProgressDialog with the value STYLE_SPINNER.

We should use setProgressDialog with the value STYLE_FINITE.


We should use setMax with the value STYLE_HORIZONTAL.

Explanation:

The setProgressStyle method defines the style of the ProgressDialog, and can be STYLE_HORIZONTAL (Loop
Finished) or STYLE_SPINNER(Infinite Loop).

Regarding the Toast class, it is correct to say that:


2.

The context parameter of the makeText() method defines the text to be displayed in the message.

It is widely used when we want to display alert messages to the user.

It is implementable through a certain static method that has two parameters.

It is useful for processing input and output data.

Displays a small screen that can be customized, with a permanent character.

Explanation:

The Toast class ([Link]) is widely used when we want to display alert messages.
for the user.

This displays a small screen, which can be customized, without a permanent nature, that is,
disappearing without any type of user intervention.

To implement this type of message, it is necessary to obtain an instance of the Toast object through
of the static method of this same class, makeText(), which has three parameters, as
demonstrated below:

[Link](context, text, duration)

In the context parameter, we define the application context to be displayed in the message;

In the text parameter, we define the text to be displayed in the message;

In the duration parameter, we can define the length of time that the message will be displayed. The message itself
The Toast class provides us with constants to define this duration time, namely
Toast.LENGTH_SHORT and Toast.LENGTH_LONG.

3. In an Android project, when we want to display messages about


alerts for the user, without permanent character, that is,
disappearing without any user intervention,
we must make use of the class:

Post

Information
Notification

Toast

Show Message

Explanation:

The Toast class ([Link]) is widely used when we want to display alert messages.
for the user.

This displays a small screen that can be customized, without a permanent nature, that is,
disappearing without any type of user intervention.

4. The AlertDialog class can display a dialog box with a


title and up to three buttons. Unlike the Toast class, we can
interact with the user through button presses.
Indicate the method of this class that defines a button that does not
cancels and does not confirm an action.

setPositiveButton

setNegativeButton

setMessageButton

setNeutralButton

setTitleButton

Explanation:

The setNeutralButton method of the AlertDialog class defines a button that neither cancels nor confirms a
action (Example: Notify me later)

5. Class that allows, in an Android project, to display a box


of dialogue with a title and up to three buttons. This class allows
still, interaction with the user through pressing the
buttons.

Select the alternative that corresponds to the definition above:

ShowDialog

Input Dialog

ProgressDialog

Dialog
AlertDialog

Explanation:

The AlertDialog class allows the display of a dialog box that can show a title, up to three
buttons, a list of selectable items or a custom layout. Furthermore, this dialog
allows interaction with the user.

6. On the Android platform, the Spinner control is used for the


presentation of a set of elements through a menu
suspense.

Analyze the following statements and choose the correct option:

I- This control is also known as DropDown (or


ComboBox.

II- The elements of the Spinner cannot be defined in a way


static in the values file [Link].

III - The [Link] interface is used


to determine which element of the set was selected.

IV- The spinnerMode=dialog definition makes the elements


to be displayed in a specific window.

All the sentences are correct.

All the sentences are incorrect.

Only one sentence is incorrect.

Only one sentence is correct.

Only two sentences are correct.

Consider the alternatives presented below, and check the one that indicates the supported unit of measure
for Android, which is widely used in specifying the font size of the application.

px

dp

sp

in

Explanation:

sp: (Scale-independent Pixels) - It is the recommended unit of measurement for specifying the size of a
source, so that it is automatically adjusted according to the user's screen preferences.

2. In mobile device applications


we use, in most cases, more than
a screen (Activities). In this way, it is
it is necessary to use mechanisms that
enable the exchange of information between
them. Therefore, if we have Activity2
what was called by Activity1, the
Activity2 should use the method
________________ to recover all of the
information received from Activity1.

getPreFab
getIntent
getInfoFab
getManifest
getReturn

Explanation:

If we have Activity2 that was called by Activity1, Activity2


you should use the method getIntent to retrieve all the
information received from Activity1.

3. Consider the alternatives presented below, and mark the one


which indicates the unit of measurement supported by Android that,
although not recommended, it corresponds to 1/72 of an inch.

px

dp

in

mm
Explanation:

pt (points) - It is a unit of measurement that corresponds to 1/72 of an inch, according to the size
physical screen size of the device. For this reason, the use of this unit of measurement is not recommended.

4. A style in Android corresponds to a set of properties.


that specify the appearance and format for a View. A theme
it is a style applied to a single Activity or the entire application, instead
from an individual View. When a style is applied as a
theme, all Views in the Activity or application will use all the
style properties defined by him. Mark the alternative
correct that defines a theme for a specific activity:

activity android:interface="@style/MyTheme"

activity android:style="@style/MyTheme"

activity android:view="@style/MeyTema"

activity android:config="@style/MyTheme"

android:theme="@style/MyTheme"

Explanation:

The command application android:theme="@style/MyTheme" defines the MyTheme style that will be used.
as a theme across all views of the application.

The command activity android:theme="@style/MyTheme" defines the style MyTheme that will be used as
theme in all views of a specific activity.

5. What unit of measurement is commonly used in Android for the


creation of the layout, being based on the physical density of the screen?

sp

dp

px

mm

Explanation:

The density pixel (dp) is widely used in layout development. This abstract unit
it is based on the physical density of the screen.

The proportion of dp can change with the screen density, but not its presentation.
6. Just like the dimensions, we can also define the color.
directly on our properties or, as recommended, in
a file called [Link]. The RGB (Red/Green/Blue) standard
is used to define colors on Android screens. Mark the option
correct definition of the color green:

#0000ff

#00gg00

#00ff00

#gg0000

#ff0000

Explanation:

The RGB (Red/Green/Blue) standard is used to define colors on Android screens. To implement them,
we use hexadecimal notation which is based on the base 16 counting system. We need six
characters preceded by the character # to represent the color, where the first two refer to the color
red, the next two are green and the last two are blue:

Red - #ff0000

Green - #00ff00

Blue - #0000ff

Regarding data persistence in Android, it is correct to affirm:

Android allows us to persist data using SQLite.

It is not possible to save data using [Link] concepts.

The commit method commits the reading of data in a file.

The Shared Preferences class cannot be used as an alternative to the use of a database.
data.
SQLite is a library in C language that implements a non- SQL database.
embedded.

Explanation:

It is possible to save data using [Link] concepts or in a database, using SQLite.

SQLite is a library in C language that implements an embedded SQL database.

The Shared Preferences class can be used as an alternative to using a database.


The commit method finalizes the writing of data to a file.

2. Select the option that represents a database for


applications for mobile devices.

Windows Server

onReset

Sql Server

Oracle

SQLite

3. I - On the Android platform, the only way to implement the


persistent data storage is through SQLite.

BECAUSE

II - SQLite was written specifically for the platform


Android in order to maximize the system resources.

Regarding these assertions, mark the correct option:

Assertions I and II are false propositions.

Assertions I and II are true propositions, but II is not a justification for I.

Assertion I is a false proposition, and II is a true proposition.

Assertion I is a true proposition, and II is a false proposition.

Assertions I and II are true propositions, and II is a justification for I.

4. So that we can work with databases in Android it is


it is necessary that we have a class that inherits from the class

SQLiteOpenHelper

SQLite

FormBdListener

FormOpenHelper

Context
5. In an Android application that uses a SQLite database
if you want to access the methods delete, update, insert, query and
execSQL to execute operations on the database. For
to access these methods a class variable will be necessary.

SQLiteDatabaseTransaction.

SQLiteDatabase.

SQLiteStatement.

PreparedSQLiteStatement.

SQLiteDatabaseManager.

6. In an Android application that uses a SQLite database


if you want to access the delete, update, insert, query, and
execSQL to execute operations on the database. For
accessing these methods will require a class variable

SQLiteDatabaseManager.

SQLiteStatement.

PreparedSQLiteStatement.

SQLiteDatabase

SQLiteDatabaseTransaction

In an Android application that uses a SQLite database, it is desired to access the delete methods.
update, insert, query and execSQL to perform operations in the database. To access these methods
a variable of the class will be necessary

SQLiteStatement

PreparedSQLiteStatement

SQLiteDatabaseManager

SQLiteDatabaseTransaction

SQLiteDatabase

2. Android allows data manipulation with SQLite, without the


need to use SQL instructions during communication
with the DBMS. To do so, we can encapsulate the operations of
insertion, update, and deletion through
two methods of the class?
SQLiteStatement

ContentValues

SQLiteOpenHelper

SQLiteDatabase

SQLiteContentValues

Explanation: The SQLiteDatabase class provides an alternative way to manipulate data with the
SQLite. This class has encapsulated methods for insertion (insert), update
update and delete, with that, it is not necessary to use SQL statements during communication
with the DBMS.

3. For the creation of a local persistence solution on Android,


with the use of SQLite database, it must be used initially
a class responsible for creation and update events of
table structure. When changing the app version, this class will
automatically call the structural update, and in the first
execution will carry out the creation of the initial structure. The class in
the question must be a descendant of:

Cursor

SQLiteDatabase

SQLiteOpenHelper

TableFactory

ArrayAdapter

Explanation: The SQLiteOpenHelper class is designed for managing the structural model of the database,
focusing on the operations of creating and altering table structures in SQLite.

4. Which class of the Android platform has encapsulated methods?


for insert, update, and delete?

ContentValues

SQLiteStatement

SQLiteDatabase

Cursor

SQLiteOpenHelper
5. A ListView allows the display of multiple rows,
related to some data source, such as lists, vectors and
others, requiring the intermediation of an object of type
Adapter. In the case of a query to SQLite, it is always returned
a specific type of object, which provides access to the data of the
existing records in the table. What is the correct Adapter for the
filling in the list with the return data from a query
SQLite?

SimpleCursorAdapter

TableAdapter

ListAdapter

ArrayAdapter

SQLiteAdapter

Explanation: The return of a query to SQLite is of the Cursor type, and requires an Adapter of the type
SimpleCursorAdapter for filling a ListView.

6. The Android platform offers native support for storage


persistent data using a code database
open source, cross-platform and has been used
mainly in embedded applications. The architecture of
the operation of this database is different from others
traditional management systems, since all the
system functionalities are offered through a
library written in the C language. Check the alternative that
indicate the name of this library

SQLite

MysSql

SqlServer

PL/SQL

SQLTransaction

7. Observe the code snippet below:

CREATE TABLE books (


id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
author TEXT )
[Link](CREATE_BOOK_TABLE);

we can assert that obj is of the type:

SQLiteDatabase
SQLiteContext

Context

JDBC

SQLiteOpenHelper

8. On the Android platform, data manipulation in the SQLite database


is facilitated by the use of the SQLiteOpenHelper class. This class
aids the developer in the process of creation and management
the versions of the database. Mark the method of the class that
create and/or open the database,
allowing only data readings to be performed.

getOpenDatabase

getReadableDatabase

getResultDatabase

getWritableDatabase

getCursorDatabase

To make requests via the HTTP protocol, the Android API offers two alternatives. However, in recent days
From today, it is no longer recommended to use these classes, because the Google team does not maintain them.
these implementations. Point out the option that indicates the name of the class that is developed and supported
by Google, and thus, it is recommended for processing these requests.

AndroidHttpClient

HttpRequest

HttpUrlConnection

DefaultHttpClient

HttpResponse

2. Most commonly used format in the return of web services, due to its
simplicity compared to XML.

The above definition refers to:

PYTHON

URL

JSON

HTTP
CGC

3. There are several ways to access an HTTP address on


Android, and one of them is with the use of DefaultHttpClient. The connection
is opened using the execute method, which returns a
HttpResponse e, for a GET type call, receives as
parameter an object of type:

InputStream

URLGetter

HttpGet

URL

HttpEntity

Explanation: An HttpClient object opens the connection from an HttpGet or HttpPost.

4. Consider that in an Android application it is desired to indicate that


a JSON download is in progress. Therefore, we must
implement the method:

onProgressUpdate()

doInBackground()

onCreateThread()

onPostExecute()

onPreExecute()

5. According to the definition of Javadoc, an unordered collection of


name/value pairs correspond to:

JSONArray.

JSONList

JSONObject

JSON Collection

JSONVector
Explanation: A variable of type JSONObject stores a JSON object. According to the Javadoc definition.
In this class, a JSON object is an unordered collection of name/value pairs.

6. With the use of an HttpClient object for access to


HTTP, the return of the established connection is received in an object of
HttpResponse type. From there, it is possible to encapsulate the data of
HttpResponse in a HttpEntity, and gain access to the stream of
data entry through a specific HttpEntity method.
What is this method?

getJSONObject

getContent

getStringFromInputStream

getInputStream

getOutputStream

Explanation: The getContent method of the HttpEntity class returns an InputStream related to the flow of
HTTP connection data entry.

7. A common error in programming for HTTP access on Android is


the use of a connection in the midst of the Activity, that is, in the Thread
mainly, which will generate an error. Therefore, it is necessary to use
parallel execution, which can be achieved with the use of a
object of type AsyncTask. The part that will be executed in
parallel must be implemented in the method:

doInBackground

onCreate

in progress

onPreExecute

onPostExecute

You might also like