Professional Documents
Culture Documents
1.
Which method allows users to use a file for writing in the internal storage?
a. openFileInput
b. openFileReading
c. openFileWriting
d. openFileOutput
e. saveToInternalStorage
d. openFileOutput is the method that allows users to use a file for writing in the internal
storage.
In Android, the openFileOutput method is used to open a private file associated with this
Context's application package for writing. It takes in two arguments:
2.
{“item”:[{“name”:”Popescu”},{“name”:”Ionescu”}]}
a. a json array containing a json object with the property item and values Popescu and
Ionescu
b. a json object containing a property name with value Popescu
c. a json object containing a property item with and array of json objects
d. a json object containing a property item with the values name, Popescu and Ionescu
e. a json array containing one single element
R:
The file description provided is a JSON object. The object has one property called "item",
which has a value of an array. The array contains two JSON objects, each with a single
property "name" and a value of "Popescu" and "Ionescu" respectively. Therefore, option c is
correct as it describes that there is a json object containing a property item with an array of
json objects.
3.
What are the true statements regarding the following snippet of code?
a. the button is instructed to search for the onClick method at activity level
b. the button doesn’t know how to handle the on click event
c. the button uses anonymous classes for managing the on click event
d. the activity must override the onClick(View view) method
e. the activity is forced to implement the View.OnClickListener interface
The code snippet is defining a private variable button of type Button, and in the onCreate()
method, it calls the setOnClickListener() method on the button object, passing in this as the
argument. This tells the button that when it is clicked, it should call the onClick() method on
the current object (which is the activity because this refers to the current object).
Therefore, the activity must override the onClick(View view) method in order to handle the
click event. Also, since the activity is setting the onClickListener, it means that the activity is
implementing the View.OnClickListener interface. Option a, b, c are not correct as the code
doesn't say anything about searching onClick method at activity level, doesn't say that the
button doesn't know how to handle the on click event or use anonymous classes for
managing the on click event.
a. the button is instructed to search for the onClick method at activity level
4.
Which are the wrong intent actions, NOT used for dialing a phone number?
a. ACTION_ANSWER
b. ACTION_CALL
c. ACTION_RING
d. ACTION_PHONE
e. ACTION_DIAL
a. ACTION_ANSWER is used to answer an incoming phone call, not for dialing a phone
number.
c. ACTION_RING is used to initiate a ringtone when a phone call is incoming, not for dialing a
phone number.
d. ACTION_PHONE is used to open the dialer app, not for dialing a phone number
specifically.
5.
a. Spinner
b. WebView
c. ListView
d. AutoCompleteTextView
e. ToggleButton
f. GridView
g. ImageButton
c. ListView,
f. GridView are types of controls that can be used in conjunction with an adapter.
ListView and GridView are used to display a scrollable list of items. An adapter is
used to bind the data to the ListView or GridView, providing the elements to be
displayed in the list.
6.
a. BaseAdapter
b. GenericAdapter
c. StringAdapter
d. ListViewAdapter
e. CursorAdapter
7.
What class is used for translating geographics coordinates into street addresses or vice-a-
versa?
a. MapConverter
b. LocationProvider
c. Address
d. LocationManager
e. Geocoder
f. Geocoder is a class that is used for translating geographic coordinates into street
addresses or vice-versa. It allows to convert a street address or location name into a
latitude and longitude, and vice-versa. It can also be used to determine the address
corresponding to a given latitude and longitude and vice-versa. It can be used to
determine the country, city, and post code for a given latitude and longitude.
8.
a. displayView()
b. setContentView()
c. setView()
d. setLayoutView()
e. displayLayout()
a. displayView() is not a method that is used for displaying the layout of an activity.
b. setContentView() is the method that is used for displaying the layout of an activity. It sets
the activity content from a layout resource. The resource will be inflated, adding all top-level
views to the activity.
c. setView() is not a method that is used for displaying the layout of an activity.
d. setLayoutView() is not a method that is used for displaying the layout of an activity.
e. displayLayout() is not a method that is used for displaying the layout of an activity.
9.
a. getObjectFromJSON()
b. getObject()
c. getJSONObject()
d. getJSONArray()
The method getJSONObject() is used for initializing a JSONObject from a JSON formatted
string, or a Map or a JSONTokener.
The method getJSONArray() is used for initializing a JSONArray from a JSON formatted
string, or a JSONObject, or a Collection, or an Object array.
a. getObjectFromJSON() and b. getObject() are not used for initializing JSON objects.
10.
Canvas is an object that provides the methods for drawing on a bitmap. It receives a Bitmap
object as a parameter when it is created and can be used to draw shapes, text, and images
on the Bitmap.
It can be passed as a parameter in the onDraw() method of a custom view, where the view
can draw itself on the canvas.
e. Invalidating the view is not a direct responsibility of the Canvas, it is the process of
marking it as "dirty" and in need of redrawing, it can be achieved by calling the invalidate()
method on the view or using other methods such as postInvalidate().
a. A Canvas can be used to draw on a ShapeDrawable object, but it is not a direct receiver of
the ShapeDrawable, it is not something that you would use to "receive" a ShapeDrawable,
but rather something that can be used to draw on a ShapeDrawable.
11.
a. run();
b. onProgressUpdate();
c. onPostExecute()
d. onPreExecute()
e. doInBackground()
f. publishProgress()
d. onPreExecute()
c. onPostExecute()
b. onProgressUpdate()
12.
Which methods are used for calling the onDraw() method of a View?
a. invalidate()
b. onDraw()
c. drawing()
d. onRedraw()
e. postInvalidate()
f. rePaint()
a. invalidate()
e. postInvalidate()
The methods invalidate() and postInvalidate() are used for calling the onDraw() method of a
View.
The invalidate() method marks the view as dirty and in need of redrawing, and it causes the
onDraw() method to be called immediately by the system.
The postInvalidate() method also marks the view as dirty and schedules a redraw, but it
allows the system to wait until the next frame before calling the onDraw() method.
b. onDraw() is a method in the View class that is called by the system, it's not a method that
is called by the developer.
c. drawing() d. onRedraw() and e. rePaint() are not used for calling the onDraw() method of
a View.
13.
a. Component
b. View
c. Intent
d. Context
e. Application
f. ViewGroup
d. Context
Inside any method of an Activity class, the pointer this is referred to as a Context.
An activity is a subclass of Context and it provides a context for the app's UI. The
context is used for creating views, starting activities, and accessing system services.
14.
try{
inputStreamReader.close();
inputStream.close();
connection.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
This code is attempting to open a connection to a URL, read the contents of that URL, and
then close the connection. However, there are a few issues with the way the
HttpURLConnection class is being used:
The HttpURLConnection type is being cast to InputStream, but it should be cast to
InputStreamReader
The InputStreamReader type is being created using InputStreamReader instead of
InputStream
BufferedReader is creating using inputStreamReader but it should be created using
new BufferedReader(inputStreamReader)
These issues would cause the code to fail at runtime, and a MalformedURLException would
be caught by the catch clause.
16.
super.onCreate(savedInstanceState);
button.setOnClickListener(new View.OnClickListener() {
@Override
}
});
It should be noted that the EvenimClick class is not used in the onCreate method, but it's
there in the code. It should also be noted that this code is missing the initialization of the
button variable, it should be done before setting the click listener.
17.
a. Paint
b. ColorGradient
c. Gradient
d. Shader
e. Pixel
18.
19.
An Android Activity is a class that represents a single screen in an app. It has an associated
layout file which defines the UI and it is stored under res/layout. The activity must be
declared in the AndroidManifest.xml file so that the system can launch it. It is not used for
running background threads, it is used to interact with the user interface. The associated
XML file is not stored under res/xml, it is stored under res/layout.
20.
a. Paint
b. ColorGradient
c. Gradient
d. Shader
e. Pixel
In Android, the class used for defining gradients is the Shader class. The Shader class is the
base class for objects that return horizontal spans of colors during drawing. Shader is used
to fill the color inside shape or give an effect like linear-gradient, radial-gradient, etc. It can
be applied to a Paint object and then used to draw shapes and paths. The other classes such
as Paint, ColorGradient, Gradient, and Pixel are not used for defining gradients.
21.
c. file management
An operating system (OS) is a software that manages the hardware and software resources
of a computer. The following functions are typically part of an OS's job:
b. manages hardware and software resources: It manages the communication between the
computer's hardware and software, such as allocating memory and processing power to
different programs.
c. file management: It manages the organization and storage of files on the computer's hard
drive, including creating, deleting, and moving files.
a. checks the I/O gates: This task is done by the device driver, which is a software that allows
the operating system to interact with a hardware device.
d. manages the user interface: This task is done by the graphical user interface (GUI) which
is a part of the operating system, but it's not the main responsibility of the OS.
22.
a. Bundle class
b. Intent class
In Android, there are several elements that can be used for sending data between activities:
a. Bundle class: Bundle is a mapping from String keys to various Parcelable values. It can be
used to store a set of data as key-value pairs and then passed as an argument to an intent
when starting a new activity.
b. Intent class: An Intent is a messaging object you can use to request an action from
another app component. The Intent class is used to start new activities, and it can carry data
in the form of a Bundle object.
d. onActivityResult() method from the Activity class: This is a method that can be overridden
in an activity to receive a result from another activity that was started with
startActivityForResult() method. The onActivityResult() method will be called by the Android
system when the second activity has finished, and it returns data back to the first activity.
e. onSendingData() method from the Application class is not a valid android method.
23. Which is the Room adnotation used for defining the class associated with a table?
a. @Dao
b. @Entity
c. @Table
d. @View
e. DatabaseTable
In Android, Room is a persistence library that provides an abstraction layer over SQLite. The
@Entity annotation is used to define a class that is associated with a table in the database.
The class is annotated with @Entity and each of its properties is annotated with
@ColumnInfo. The Room will automatically create the table in the database with the same
name as the class, and it will create columns for each of the properties.
a. @Dao: used to define data access objects, which are classes that handle database
operations
c. @Table: used to configure the table name and other options associated with the table
d. @View: used to define the views, which are classes that present data from multiple tables
24.
a. Private storage
b. Cache memory
c. Public storage
d. Internal storage
e. External storage
f. Remote storage
In Android, SharedPreferences is a way to store key-value pairs of data persistently. The files
containing the SharedPreferences data can be stored in different locations depending on
the storage mode selected:
a. Private storage: SharedPreferences files can be stored in the private storage of the app,
which means that they are only accessible by that app.
d. Internal storage: SharedPreferences files can be stored in the internal storage of the
device, which is not accessible by other apps.
e. External storage: SharedPreferences files can be stored in the external storage of the
device, which is accessible by other apps, but the storage should be considered as
removable storage and the file may not be present at all times.
b. Cache memory: SharedPreferences files should not be stored in the cache memory, as it is
intended for temporary data that can be deleted by the system at any time to free up space.
c. Public storage: Public storage is not a valid location for storing SharedPreferences files.
But SharedPreferences files cannot be stored in remote storage such as a remote server
or cloud storage, because SharedPreferences is a local storage mechanism, it stores data
on the device, and it can't be accessed remotely.
26.
What Android permissions are required for getting the most accurate location using a
location provider?
a. ACCESS_FINE_LOCATION
b. ACCESS_COARSE_LOCATION
c. ACCESS_LOCATION
d. READ_NETWORK_LOCATION
e. ACCESS_NETWORK_LOCATION
Which of the following scales is recommend being used for Android controls?
a. px (pixels)
c. in (inches)
e. pt (points)
d. dp (density independent pixels) is recommended for Android controls. This scale is based
on the physical density of the screen, so it allows for consistent size across different screen
densities. It's designed to be used in conjunction with the screen density to ensure that
elements are the same physical size on any screen. On the other hand, px (pixels) is based
on the resolution of the screen, so it can vary on different devices with different screen
resolutions. sp (scale independent pixels) is used for font size only. in (inches) and pt
(points) are not recommended for Android controls because they are not density
independent.
28.
For passing an instance of a user defined class between Android components using an Intent
is necessary to:
29.
a. onOptionsltemSelected()
b. onContextItemSelected()
c. registerForContextMenu()
d. onCreateOptionsMenultem()
e. onOptionsMenultemSelected()
a. ScrollView
b. LinearLayout
c. ConstraintLayout
d. TableLayout
e. RelativeLayout
f. TotalLayout
g. GridLayout
31.Which of the following are methods specific to the activity life cycle?
a. onFinish
b. onStart
c. onRun
d. onResume
e. onTerminate
f. onPause
g. onCreate
h. onEnd
i. onDestroy
These are methods that are specific to the activity life cycle in Android, and they are
called at specific points in the life of an activity. onCreate is called when an activity is first
created, onStart is called when an activity becomes visible to the user, onResume is
called when the activity starts interacting with the user, onPause is called when the
activity is no longer visible to the user, onStop is called when the activity is no longer
visible and it's about to be destroyed and onDestroy is called when the activity is
destroyed.
a. It is an implicit intent
b. It is not correct initialized
c. It is an explicit intent
d. Can be used to open a new Activity
e. Can be used to pass data
f. Can include the bundle class
This line of code creates an explicit Intent, which is used to start a new Activity by
specifying the class name of the Activity to be started. The first parameter of the Intent
constructor is the context, in this case "this" refers to the current activity. The second
parameter is the class of the activity you want to open. You can use this intent to pass data
between activities by calling intent.putExtra("key", value) and retrieve the data by calling
getIntent().getExtra("key"). Also, you can include additional data, such as a Bundle, by
calling intent.putExtras(bundle) or intent.getExtras()
33.For the following snippet of code choose the correct statements that are used for
storing the birth date into a SharedPreference file.
//Salvare zi de nastere
a. editor.putDate(birthdate);
b. editor.save()
c. editor.commit
d. editor.putString(“BIRTHDATE”, new SimpleDateFormat(“dd-MM-
yyyy”).format(birthdate));
e. editor.apply()
SharedPreferences are used to store key-value pairs of primitive data types. In this case,
the date object cannot be directly stored into a SharedPreference file, so it needs to be
converted to a string format. In this snippet of code, a new SimpleDateFormat object is
created to format the date object into a string with the format "dd-MM-yyyy" and this string
is stored in the SharedPreference file with the key "BIRTHDATE". editor.apply() is used to
apply the changes asynchronously, it commits the changes to the shared preferences file.
a. editor.putDate(birthdate); is not a valid method in SharedPreferences b. editor.save() is
not a valid method in SharedPreferences c. editor.commit is a method that is used to commit
the changes synchronously, it commits the changes to the shared preferences file.
34. For initializing a visual control priorly defined in the xml layout of an activity, which
method should you use:
a. getViewById()
b. findViewById()
c. findViewByName()
d. getViewByName()
e. getControlById()
f. findControlByName()
g. findControlById()
In this example, my_button is the ID of the button defined in the XML layout, and R.id is a
class that holds the IDs of all controls defined in the XML layout.
35. Which property sets the distance between the content and the boundaries of a control?
a. size
b. padding (Yes, padding sets the distance between the content and the boundaries of a
control in Android. Padding is the space between the content of a view and its outer
boundary. It can be applied to all four sides of the view, and it can be set in pixels or as a
dimension resource. It can be used to control the space between the content of a view and
its edges, and it can be used to create visual consistency among different views and layouts
in an app.)
c. width
d. height
e. margin (No, margin sets the distance between the boundaries of a control and its
surrounding layout. Margin is the space outside of the view's border. It can be applied to all
four sides of the view, and it can be set in pixels or as a dimension resource. It can be used to
control the spacing between views and the edges of the layout, and it can be used to create
visual consistency among different views and layouts in an app.)
The margin property sets the distance between the content of a control and the
boundaries of the control. It is used to create space around the control, separating it from
other controls or the edges of the screen. Margins can be set individually for each side of the
control (left, right, top, bottom) or all at once. The values of the margins are set in pixels, dp
(density-independent pixels), sp (scaled pixels), or other units.
a. size: it's not a property that sets the distance between the content and the boundaries of
a control. b. padding: it's the space between the content and the border of the control, it's
similar to margins but it's inside the control. c. width: it's the width of the control. d. height:
it's the height of the control.
36. Which of the following storage classes are valid in an SQLite database?
a. INTEGER
b. TEXT
c. NULL
d. DATETIME
e. STRING
f. BOOLEAN
g. REAL
h. BLOB
INTEGER, is used to store signed integers (whole numbers) TEXT, is used to store text
strings NULL, is used to store null values REAL, is used to store floating-point numbers
(decimal values) BLOB, is used to store binary data (images, audio, or other files)
System on a Chip
38. Which building management tools can be used implicitly (by default) in Android?
a. Gradle
b. Ant
c. MSBuild
d. CMake
e. Maven
Gradle is the default building management tool used in Android for building and
managing projects. It is a powerful and flexible build tool that uses a Groovy-based domain-
specific language (DSL) to define build scripts. Gradle is able to handle complex
dependencies and provides advanced features such as multi-project builds, incremental
builds, and build caching. It can be used to automate the building, testing, and deployment
of Android applications. Gradle is integrated with Android Studio, the official IDE for Android
development, and it is the recommended tool for building and managing Android projects.
The handler has a reference to the Looper class, which is an object that runs in the
background and dispatches messages to the appropriate thread. The Looper checks the
message queue for new messages and sends them to the handler for processing.
A handler can post messages into the MessageQueue, these messages can contain a
Runnable object, which will be executed by the thread the Looper is associated with.
b. knows how to handle runnable objects: The handler doesn't "know" how to handle
runnable objects, but it can post them to the MessageQueue for execution c. used for
processing resources based on their unique identifier: A handler is not responsible for
processing resources based on their unique identifier. e. block messages coming from a
specific thread: A handler can't block messages coming from a specific thread, but it can
remove messages from the queue or process them in a specific way based on the type or the
sender of the message.
ARGB
41. What other controls can be used to simulate the behaviour of a RadioButton in a
RadioGroup?
a. Switch
b. Chip
c. Button
d. ToggleButton
e. CheckBox
A CheckBox is also a binary choice control, but it can be used to simulate the
behavior of a RadioButton by using only one CheckBox per option and clear the selection on
the other options when one is selected.
a. getCount()
b. getItem()
c. getItemId()
d. getRow()
e. getView()
f. getItemPosition()
g. getPosition()
BaseAdapter is an abstract class that serves as the base class for adapters that can
be used in ListViews, GridViews, and Spinner controls. It provides a basic implementation of
some common methods that need to be overridden by the subclass.
getCount() is a method that returns the number of items in the adapter. It is used to
determine the number of items to be displayed in the list.
getItem(int position) is a method that returns the data item associated with the specified
position in the data set.
getItemId(int position) is a method that returns the row id associated with the specified
position in the list.
getView(int position, View convertView, ViewGroup parent) is a method that returns a view
that represents an item in the data set. It is used to create and bind views to the data.
43. What is the role of an Android adapter? (asta e putin cu semnul intrebarii)
An android adapter's role is to bridge the data and the UI, it behaves as an adapter
between the data and the UI. It creates a view for each item in the collection, manages
items inside data collections and mitigates the interaction between the data source and
controls by handling the data and creating the views that are displayed in the controls.
c. To bind the control of the data source: An adapter's role is to bind the data source to
the controls, not to control the data source.
a. To control how the data is handled by the user: An adapter's role is to provide data to
the UI, not to control how the user handles the data.
a. Satellite
b. Normal
c. Terrain
d. Hybrid
e. Panoramic
f. Native
g. Road
a. Spinner
b. WebView
c. ListView
d. AutoCompleteTextView
e. ToggleButton
f. GridView
g. ImageButton
An adapter can be used in conjunction with several types of controls in Android, some of
them are:
Spinner: A spinner is a drop-down list that allows users to select an item from a list. It
uses an adapter to bind the data to the spinner.
ListView: A list view is a vertically scrolling list of items. It uses an adapter to bind the
data to the list view.
AutoCompleteTextView: An AutoCompleteTextView is an editable text view that
shows a list of suggestions based on the characters that the user types. It uses an
adapter to bind the data to the suggestions list.
GridView: A GridView is a view group that displays items in a two-dimensional,
scrollable grid. It uses an adapter to bind the data to the grid view.
b. WebView is a control that is used to display web pages, it's not commonly used in
conjunction with an adapter e. ToggleButton is a control that is used to represent a binary
choice, it's not commonly used in conjunction with an adapter g. ImageButton is a control
that is used to display a button with an image, it's not commonly used in conjunction with an
adapter
47.
try {
bufferedReader.close();
inputStreamReader.close();
inputStream.close();
connection.disconnect();
} catch (MalformedURLException e) {
e.prinStackTrace();
} catch (IOException e) {
e.printStackTrace();
a) The code doesn’t compile: This is correct because there are several syntax errors in
the code. The URL constructor takes a string argument, but the string is not enclosed
in quotation marks. Also, the printStackTrace() method is misspelled and the last '}' is
not needed.
b) The code triggers a runtime exception: This is not correct because the code is not
functional due to the syntax errors mentioned in option a. It will not run to trigger
any exception.
a) onInit
b) onCreate
c) onTrigger
d) onStart
e) onInitialization
f) onBuild
b) onCreate
The first method called when instantiating an Activity is onCreate(). This method is called
when the activity is first created and is responsible for initializing the activity and setting up
the user interface. It is also where you can inflate your layout, set up any views, and perform
any other initialization tasks that need to be done when the activity is first created.
The others options are wrong because they are not actual methods that are part of the
Android Activity lifecycle.
a) commit
b) execute
c) replace
d) add
a) commit
The other options you mentioned are methods that are part of the FragmentTransaction
class but they're not used for saving changes:
52. What property is necessary to be updated when upgrading the structure of a database?
a) iteration
b) level
c) stage
d) version
e) number
d) version
When upgrading the structure of a database, it is necessary to update the version property
of the database. This property, usually an integer, is used by the database management
system to keep track of the current schema version. When the database is opened and the
version number stored in the database does not match the version number of the
application, the database management system will know to run the necessary migration
code to upgrade the database to the new schema.
The other options you mentioned are not associated with upgrading the structure of a
database:
So the correct property that is necessary to be updated when upgrading the structure of a
database is version.
53. Which of the following methods could be called when an activity goes in the
background?
a) onPause()
b) onDestroy()
c) onStop()
d) onFinish()
e) onResume()
f) onCreate()
g) onStart()
a) onPause()
c) onStop()
When an activity goes in the background, the system calls the onPause() and onStop()
methods.
onPause() is called when the activity is no longer in the foreground and it is used to release
resources and stop animations and other things that are consuming CPU. This method is also
used to save the current state of the activity if it is likely to be destroyed.
onStop() is called when the activity is no longer visible on the screen and it is used to release
resources that are not needed while the activity is not visible.
The other options you mentioned are methods that are part of the Android Activity lifecycle,
but they are not called when an activity goes in the background:
b) onDestroy(): This method is called before the activity is destroyed.
e) onResume(): This method is called when the activity comes to the foreground
g) onStart(): This method is called after onCreate() or onRestart() and before onResume().
a) Kotlin
b) Swift
c) Objective-C
d) Scala
e) Python
f) Java
g) C/C++
The native code for the Android OS is written primarily in C and C++.
Android is a mobile operating system that is based on the Linux kernel. The Android
operating system is written in a combination of languages, including C and C++ for the core
system and Java for the application framework. The C and C++ code is responsible for the
low-level operations of the system, such as memory management, process management,
and device drivers. The Java code, on the other hand, provides the framework for
developing Android applications and interacts with the C and C++ code through the Java
Native Interface (JNI). This allows Java code to call C and C++ code and vice versa, providing
a powerful and flexible development environment for Android apps.
57) For the following snippet of code choose the correct statement that allows user to
update the content of the listView as he adds new objects to the collection.
@Override
setContentView(R.layout.activity_main);
listView = findViewById(R.id.lv_students);
listView.setAdapter(adapter) ;
students.add(new Student()) ;
a) listView.notify();
b) adapter.notify();
c) adapter.notifyDataSetChanged()
d) listView.notifyDataSetChanged() (LA FEL CA LA CEALALTA DE MAI SUS NU STIU DACA
RASPUNSUL ASTA E CORECT SAU NU, NU SE VEDE IN POZA)
The ArrayAdapter class has a method called "notifyDataSetChanged()" which updates the
listView when the data in the adapter has been changed. It will update the ListView to
reflect the new data in the adapter, this include adding new data to the adapter, removing
data from the adapter, or changing the data in the adapter. In this case, when adding new
Student to the students list, the call of adapter.notifyDataSetChanged() will update the
ListView to show the new Student.
It's important to note that the notify() method does not exist in the ListView or the
ArrayAdapter class, and calling it will cause a compile error. The
listView.notifyDataSetChanged() method is not the correct statement, it only
notifyDataSetChanged() method is a member of ArrayAdapter class.
60) What property is used for centering the control inside the parent?
a) android:layout_gravity
b) android:layout_allign
c) android:layout_float
d) android:layout_center
e) android:layout_middle
The layout_gravity attribute is used to specify how a child view should position itself within
its parent. By setting the value of layout_gravity to "center", the child view will be centered
within its parent.
61) What is a correct statement about the R.java class in an Android project:
The R.java file is a generated source file that contains resource identifiers for all the
resources in your project. It is created by the Android build system and is used to access
different sets of resources, such as strings, images, layouts, and more. It is created
automatically by the Android build system and should not be edited manually. The file is
located in the gen folder of your project and is used by the Android operating system to
access the resources needed by your app. The R class contains static constant values for
each type of resource, such as layouts, strings, and colors. These constant values can be
used in your Java code to reference resources, rather than hard-coding their values. The
R.java file is mandatory and it is created automatically, it is not necessary to create it
manually.
62) The control used for selecting a value from a given interval is?
a) ProgressBar
b) Slider
c) ActionBar
d) SeekBar
e) SelectBar
f) Button
A SeekBar is a control used for selecting a value from a given interval. It is similar to a Slider,
but it allows the user to interact with the control by dragging a thumb along the track to set
the value. It can be used for tasks such as adjusting the volume on a media player, adjusting
the brightness of a screen, or adjusting the speed of a video. It is often used in conjunction
with a ProgressBar, which displays the current value of the SeekBar to the user.
63) The code sequence found inside the <intent-filter> tag will:
<intent-filter>
</intent-filter>
</activity>
a) filter the content send by the activity when using Intent objects
The code sequence found inside the <intent-filter> tag is used to specify the intent filter for
the activity, in this case MainActivity2. The intent filter defines the type of intents that an
activity, service, or broadcast receiver can respond to. In this case the action
android.intent.action.MAIN indicates that this activity serves as the entry point for the
application. And the category android.intent.category.LAUNCHER indicates that this activity
should be listed in the app launcher, so when the app is open, this MainActivity2 will be
launched.
8. Includerea de elemente cu imagini asociate intr-un control de tip lista (Spinner, ListView etc)
se realizaeaza prin intermediul unui adaptor:
- Personalizat(CustomAdapter)
10. Which are the wrong intent actions, NOT used for dialing a phone number?
- ACTION-ANSWER
- ACTION-RING
- ACTION-PHONE
12. Pentru afișarea unei activități se apelează metoda …. Din clasa Context
- startActivity()
13. Pentru lucru dynamic cu argumente, in fisierul layout, containerul asociat va fi de tip:
- Fragment
14. What methods needs to be called to be sure that changes you made in a SQLite db will be
saved?
- SQLiteDatabase.setTransactionsSuccesful()
17. Care este ordinea de apel a metodelor din ciclul de viată al activităților?
- onCreate() -> onStart() -> onResume() -> onPause() -> onStop() -> onDestroy()
19. Android
- Este bazat pe kernelul de Linux
25. Afirmatiile: "Scripturile Gradle sunt NU folosite pentru build automat" si"Există câte un fișier
gradle pentru fiecare modul" sunt:
- Prima falsa si a doua adevarata
91. Apelul și pornirea procesări pe firul secundar de execuție se face prin intermediul metodei:
- Execute(params)
93. Care metodă din clasa AsyncTask rulează pe firul secundar de execuție:
- doInBackround()
94. Parametrii sunt trimiși de la firul principal către firul secundar in cadrul metodei
- doInBackround()
97. Pentru selectia unui element dintr-un control de tip Spinner se implementeaza
metoda______ din interafta specifica:
- onItemSelected()
99. Initializarea unui obiect din fisierul JSON se realizeaza cu ajutorul metodei:
- getJSONObject()
100. Care este coloana care trebuie selectata cand se utilizeaza un obiect de tipul
SimpleCursorAdapter?
- _id
102. La utilizarea Firebase Realtime Database intr-o aplicatie Android, initializarea si referirea
bazei de date se realizeaza prin intermediu clasei:
- FirebaseDatabase
103. Platforma Firebase pune la dispozitie urmatoarele baze de date, ce pot fi utilizate in
aplicatiile mobile:
- Realtime Database ?i Cloud Storage
- intent.putExtra(EXPENSE_KEY,object)
- setResult(RESULT_OK, intent)
- intent = getIntent()
1. Pentru afișarea unui mesaj de informare pentru o durata nedeterminata NU se utilizează clasa:
- Toast
3. Serviciile:
- ruleaza in paralel cu firul principal de executie si nu au interfata grafica
6. Selectia unui Contact prin intermediul unui obiect de tip Intent se realizeaza prin intermediul
actiunii:
ACTION_PICK
7. Directorul permite includerea oricărui tip de fișiersi referirea acestuia prin intermediul unui
identificator deresursa:
- res/raw