PRM392_note
PRM392_note
a) App developers can send data from their servers to their apps installed on Android
devices even if the apps are not running currently using Android C2DM.
c) Fragments describe portions of an app’s user interface, which can be combined into one
screen or used across multiple screens.
d) With web services, you can create mashups, which enable you to rapidly develop apps
by quickly combining complementary web services, often from different organizations and
possibly other forms of information feeds.
e) Android uses a collection of packages, which are named groups of related, predefined
classes.
f) The Android emulator, included in the Android SDK, allows you to run Android apps in a
simulated environment within Windows, Mac OS X, or Linux.
h) Using NFC Android Beam allows you to touch two Android devices to share content.
i) You send messages to an object. Each message is a(n) method call that tells a method of
the object to perform its task.
a) Android 2.2 introduced external storage, which allows one to store apps on an
external memory device.
Answer: False
b) Cloud computing allows one to use software and data stored in the local machines.
Answer: False
c) Java is neither object-oriented nor has access to extensive class libraries that help
you develop powerful apps quickly.
Answer: False
b) The classes that objects come from are essentially reusable software components; they
include attributes and behaviors.
Answer: classes
c) The process of analyzing and designing a system from an object-oriented point of view is
called object-oriented analysis and design (OOAD).
Answer: object-oriented analysis and design (OOAD)
e) The size, shape, color, and weight of an object are considered attributes of the object’s
class.
Answer: attributes
f) A class that represents a bank account might contain one method to deposit money to an
account, another to withdraw money from an account, and a third to inquire what the
account’s current balance is.
Answer: method
g) You must build an object of a class before a program can perform the tasks that the
class’s methods define—this process is called instantiation.
Answer: instantiation
h) The balance of a bank account class is an example of a(n) attribute of that class.
Answer: attribute
i) Your project’s requirements define what the system is supposed to do and your design
specifies how the system should do it.
Answer: how
Chaper 2
a) Android and the Google Play Store use package name as the app’s unique identifier,
which must remain the same through all versions of your app.
b) When designing an Android GUI, you typically want it to be scalable so that it displays
properly on various devices.
c) Resource folder names that begin with values contain XML files that specify values for
arrays, colors, dimensions, strings, and styles.
d) Images for the medium-density screens of older Android devices are placed in the folders
drawable-mdpi and drawable-ldpi, respectively.
e) To run an app in an Android Virtual Device (AVD), right click the app’s root node in
Eclipse in the Project Explorer window and select Run As > Android Application.
f) Explore by Touch enables the user to hear TalkBack speak what’s on the screen where
the user touches.
a) An Android app can be compiled using SDK with an API level that is lesser than the
Target SDK, provided that it supports all the APIs used in your app.
Answer: True
c) Android’s Explore by Touch feature enables a device to speak out the entire text on
the screen.
Answer: False
d) The resource ID in Android is the resource’s (such as layout, image) file name
without the extension.
Answer: True
e) For people with visual disabilities, Android’s SpeakBack can speak screen text or
text that you provide to help the user understand the purpose of a GUI component.
Answer: False
f) It’s considered a best practice in Android to ensure that every GUI component can
be used with TalkBack by providing text for the Content Description property of any
component that does not display text.
Answer: True
Chapter 3
a) A LinearLayout can arrange views either horizontally or vertically and size its views
proportionally.
b) Use a(n) GridLayout to arrange GUI components into cells in a rectangular grid.
c) The Outline window makes these tasks easier because it shows the nested structure of
the GUI, so in a GridLayout, you can select the appropriate row and add a GUI component
to it.
d) Class Activity of package android.app provides the basic lifecycle methods of an app.
g) The method onCreate is called by the system when an Activity is starting—that is, when
its GUI is about to be displayed so that the user can interact with the Activity.
h) As you build your app’s GUI and add resources (such as strings in the strings.xml file or
GUI components in the activity_main.xml file) to your app, the IDE generates a class named
R that contains nested static classes representing each type of resource in your project’s res
folder.
i) Class R.drawable (nested in class R) contains constants for any drawable items, such as
images, that you put in the various drawable folders in your app’s res folder.
j) Class R.string (nested in class R) contains constants for each String in the strings.xml file.
k) Once the layout is inflated, you can get references to the individual widgets using
Activity’s findViewById method. This method takes an int constant for a specific view (that
is, a GUI component) and returns a reference to it.
a) Method onCreate typically initializes the Activity’s instance variables and GUI
components. This method should be as simple as possible so that the app loads
quickly. In fact, if the app takes longer than five seconds to load, the operating system
will display an ANR (Application Not Responding) dialog—giving the user the option
to forcibly terminate the app.
Answer: True
b) To center a TextView’s text, in the Properties window of TextView, set the layout
Gravity property to center.
Answer: False
d) Each Activity lifecycle method you override need not call the superclass’s version
of the same method.
Answer: False
e) A stopped activity is visible on the screen and is likely to be killed by the system
when its memory is needed.
Answer: False
1.To preserve the visible size of your Ul on screens with different densities, you must design
your Ul using density (A) pixels (dp) as your unit of measurement. One dp is a virtual pixel
unit that's roughly equal to one pixel on a (B)density screen (160dpi: the "baseline" density).
Android translates this value to the appropriate number of real pixels for each other density.
A. independent, B.high
A. independent, B.normal
A. resolution, B.medium
2.What folder in android project can we use to store a file that will be reserved originally
in .apk file?
assets folder
values folder
drawable folder
menu folder
5.Which of the followings can we use to define position for a view item in a
ConstraintLayout?
layout_constraintStart-toEndOf and layout_constraint Top-toBottomOf
layout-constraintStart toEndOf and layout-constraint Top_toBottomOf
layout_constraintStart_toEndOf and layout_constraintTop_toBottomOf
layout-constraintStart-toEndOf and layout-constraint Top-toBottomOf
6.What component in the Android platform provides services like Location. Telephony, and
Sensor Management?
Android Runtime
Application Framework
Linux Kernel
Hardware Abstraction Layer
7.For EditText views, it's not a good practice to provide hints because hints clutter the input
field. True or false?
True
False
9.Which feature allows a view in ConstraintLayout to align its baseline with another view's
baseline?
layout_alignBaseline With
layout_alignWithParentifMissing
layout constraintBaseline_toBaselineOf
layout_constraintAlignParentlaseline
10.Android: Which attribute will be used in XML if the Java code needs a reference to View?
android: gravity
android background
android: id
android: index
16.Specify the directory name where the XML layout files are stored:
/res/layout
/assets
/src
/res/values
17.In android, Hardware Abstraction Layer (HAL) is a layer between C/C++ libraries layer
and Linux kernel layer?
True
False
19.Which of the following is a correct statement to apply theme for an android activity?
android:theme="@style/YourTheme"
20.Paused is used
If the activity is at the foreground and visible
If the activity is at the foreground
If the activity is at the background and still visible
If the activity is not visible
25.Which of the following can we use to set width and height for a view item to match with
parent view?
match parent and wrap_content
MATCH_PARENT and WRAP_CONTENT
MATCH-PARENT and WRAP-CONTENT
wrap-content and match-parent
30.Which of the below choices is the best answer to fill the empty space in the following
sentence? If you want to give all text widgets in an app the same format such as font color,
font size, and fort family, you should add the style attribute to the TextView XML tags in
layout file and set the attribute value to the same style name. You should define that style by
adding a new style tag inside
styles.xml file
AndroidManifest.xml file
MainActivity java or MainActivity.kt file
activity main.xml fic
33.In a layout file for an activity, we need to deline a LayoutManager as a root to manage all
views in the screen?
True
False
Which of the below choices is the best answer to fill the empty space in the following
sentence? If you want to give all text widgets in an app the same format such as font
color, font size, and font family, you should add the style attribute to the TextView
XML tags in layout file and set the attribute value to the same style name. You
should define that style by adding a new style tag inside _______________.
A. AndroidManifest.xml file
B. MainActivity.java or MainActivity.kt file
C. styles.xml file
D. activity_main.xml file
C
To preserve the visible size of your Ul on screens with different densities, you must
design your Ul using density-(A)__________ pixels (dp) as your unit of
measurement. One dp is a virtual pixel unit that's roughly equal to one pixel on a (B)
____________ -density screen (160dpi; the "baseline" density). Android translates
this value to the appropriate number of real pixels for each other density.
A. A.independent, B.high
B. A.independent, B.medium
C. A.resolution, B.medium
D. A.independent, B.normal
B
What is the purpose of super.onCreate in android?
A. To create an activity
B. To create a graphical window for subclass
C. It allows the developers to write the program
D. None
B
How can we kill an activity in android?
A. Linux kernel
B. MAC kernel
C. Windows kernel
D. Hybrid Kernel
A
Android SDK platform is a set of libraries and APIs that provide necessary classes,
methods and interfaces to develop Android applications and allow you to compile
your code.
A. True
B. False
A
If you want to increase the whitespace between widgets, you will need to use the
_____________ property.
A. android:distance
B. android:text-align
C. android:margin
D. android:autoText
C
To configure your style theme your app activities (entire app), open
AndroidManifest.xml, and set the theme by adding
android:theme="@style/your_style_name" attribute to the ____________.
A. <intent-filter> tag
B. <manifest> tag
C. <activity> tag
D. <application> tag
D
Which of the following callback is called when an activity starts interacting with the
user?
A. onDestroy
B. onCreate
C. onResume
D. onStop
C
What is NOT an activity lifetime?
A. Background lifetime
B. Visible lifetime
C. Entire lifetime
D. Foreground lifetime
A
Which one is make the size of an element in the layout fit with the children of its?
A. match-parent
B. fixed
C. wrap-constraint
D. wrap-content
D
_____________ represents a single user interface screen.
A. Activity
B. Fragment
C. Layout
D. View
A
Specify the directory name where the XML layout files are stored:
A. /src
B. /res/layout
C. /assets
D. /res/values
B
Paused is used_____________
A. Active
B. Stored
C. Paused
D. Stopped
B
Resource Manager is used for?
A. Controls all aspects of the application lifecycle and activity stack.
B. Allows applications to publish and share data with other applications.
C. Provides access to non-code embedded resources such strings, color settings
and user interface layouts.
D. Allows applications to display alerts and notifications to the user.
C
Which is NOT a callback method for an event listener?
A. onLongClickListener()
B. onClickedListener()
C. onClickListener()
D. onTouchListener()
B
Which of the following choices is the best answer to fill the empty space in the
following sentence? Adding a new color to the colors.xml file in Android Studio
(/res/values/colors.xml) helps the app developers to use this new color as text color
attribute value for the ______________ attribute in all these app layouts.
A. color:textformat
B. java:textcolor
C. Kotlin:textcolor
D. android:textColor
D
All layout classes are the subclasses of ______________
A. android.widget
B. android.view.View
C. android.view.ViewGroup
D. None
C
The root element of AndroidManifest.xml is:
A. manifest
B. action
C. application
D. activity
A
Which of the following choices is the recommended syntax to change the font size to
18?
A. android:textSize="18dp"
B. android:textSize="18sp"
C. android:textSize="18dip"
D. android:textSize="18pt"
B
Which one is a touch action?
A. ACTION_MOVING
B. ACTION_PRESS
C. ACTION_TAP
D. ACTION_MOVE
D
What is AVD?
A. True
B. False
B
Each Android application runs in its own process and with its own instance of ART
on devices running Android version 8.0 (API Level 26) or higher.
A. True
B. False
A
In a ConstraintLayout, which of the following constraints are needed to position a
view onscreen?
Which of the following is CORRECT about the Toast class? (Choose 3 answers)
A. You cannot a custom layout for a Toast
B. A Toast can only created by an Activity class
C. There no need to close or hide a Toast, since it closes automatically.
D. A Toast is displayed for only one of the following periods:
Toast.LENGHT_SHORT or Toast.LENGHT_LONG
ACD
Which of the following is INCORRECT about the LogCat tool? (Choose 3 answers)
A. LogCat UI tool is availiable inside Android Studio.
B. You can create a log in your application using Log.v(String, String)
C. Each log message hag a tag
D. Only one of your applications can create log entries, and it should be component
class(Activity, Service,..ect)
ABC
Which of the following information CANNOT be included in the Manifest file?
A. The activities containes in the application
B. The permissions required by the application
C. The application's minimun SDK version required
D. The handset model compatible with your application
D
Which of the following classes should be extended to create a custom view?
A. View
B. ViewGroup
C. Context
D. Activity
A
Which of the following is a correct constructer for ArrayAdapter? (Choose 3 answers)
A. ArayAdapter(Context context)
B. ArayAdapter(Context context, int recourse)
C.ArayAdapter(Context context, int resourse, int textViewResourceId)
D.ArayAdapter(Context context, int ressourse, List<T>items)
BCD
Which of the following Activity life-cycle methods is called once the activity is no
longer visible?
A. onStop
B. onPause
C. onDestroy
D. onHide
A
Which of the following is NOT a correct Android Manifest statement? (Choose 3
answers)
A. <uses-permission android:name="android.Internet"/>
B. <uses-permission android:name="android.Internet"></uses-permission>
C. <uses-permission android:name="android.permission.Internet">
D. <uses-permission android:name="android.permission.Internet"/>
ABC
What two methods you have to override when implementing Androif context menus?
A. onCreateOptionsMenu, onCreateContectMenu
B. onCreateContextMenu, onContextItemSelected
C. onCreateOptionsMenu, onOptionsItemSelected
D. onCreateOptionsMenu, onContextItemSelected
B
Which of the following Activity methods is invoked when the user clicks on an options
menu item?
A. onItemClicked
B. onItemSelected
C. onOptionsItemClicked
D. onOptionsItemSelected
D
Which of the following is the base class of all UI components?
A. ListView
B. Layout
C. View
D. ViewGroup
C
What are the main two types of threads in Android?
A. Main thread and worker threads
B. Main thread and UI thread
C. Activities and services
D. Main thread and background process
A
Which of the following is true about method startActivity?
A. It start a new activity and destroys the previous one
B. It start a new activity and sends it to the foreground
C. It start a new activity and resumes the previous one
D. It starts a new activity in a paused madel
B
Which of the following best explains the Android option menus?
A. Its is a popus menu that displays a list of item in a vertical list anchored to the
view that invoked the menu
B. Its is a floating menu that appears when the user performs a long-click on an
element. It provides actions that affect the selected content or contect frame
C. It is the primary collection of menu items for an activity where you should place
actions that have a global on the app, such as "Search," "Compose email,"
and"Settings"
D. It is a type of List Activity with predefined headers and footers for
specialcommands
C
Which of the following perission is necessary for capturing geo-coordinates?
A. android.permission.ACCESS_LOCATION
B. android.permission.ACCESS_LOCATION_FINE
C. android.permission.ACCESS_FINE_LOCATION
D. All answers are incorrect
C
CardView extends from which of the following:
A. RelativeLayout
B. LinearLayout.
C. TableLayout
D. FrameLayout
D
Which of the following adds a click listenes to items in a ListView?
A. setonClickListener
B. setOnItemClickListener
C. setonItemClicked
D. setonLisItemClickListener
B
Which of the foloowing is true about object arrayAdapter declared in the code below?
String[]items =
{"Item 1","Item 2", "Item 3"};
ArrayAdapter<String>arrayAdapter = new
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items);
listView.setAdapter(arrayAdapter);
A. It creates a textView for each String in array items.
B. It creates Buttons for each String in array items.
C. It creates four views for listView
A
Which folder contains XML files?
A. AndroidMainfest
B. resources
C. res
D. java
E. src
C
Which of the following is NOT correct about XML layout files? (Choose 3 answers)
A. In order to display a UI in the XML layout file"main.xml", call the setContentView
method of the activity with the parameter string "main.xml"
B. The is no distinction between implementation of the layout definition by code, or
by XML layout file
C. In a project using the ADT plugin, the XML layout file is found in
the/res/layoutdirectory
D. Layout information written in thje XML layout file will be converted into code by the
Android platform when the screen is displayed
ABD
The DalvikVM core libraries are a subset of which the following?
A. Java ME
B. Java SE
C. Java EE
D. JAX-WS
B
Choose Android basic components (Choose 2 answers)
A. Activity
B. Content provider
C. RecyclerView
D. Fregment
AB
In order to open screenB from screenA and receive data from screenB which
sentence should we use?
A. startActivityForResult
B. startActivity
C. startActivities
D. Both of A and B
A
To reuse rows in ListView, we use
A. Adapter
B. ItemView
C. ViewHolder
D. All of the above
C
From Android 6.0, there is a difference in:
A. Stogage
B. Permission
C. Database
D. All of the above
B
The command to clear all data in a sharedPreference?
A. remove()
B. delete()
C. clear()
D. destroy()
C
Which layout has alignParent attribute?
A. LinearLayout
B. RelativeLayout
C. CoordinatorLayout
D. All of the above
B
Which component respond to messages from Android system or application?
A. Activity
B. Service
C. BroadcastReceiver
D. Intent
C
Which callbacks happens when user puts Android app to background (Choose 2
answers)
A. onPause()
B. onResume()
C. onStop()
D. onRestart()
AC
Where to declare libraries in Android application?
A. Libs directory
B. Setting.gradle
C. Build.gradle
D. AndroidManifest
C
What are components in MVVM architecture? (Choose 3 answers)
A. Model
B. View
C. View model
D. Presenter
ABC
Which method to change data in LiveData object (Choose 2 answers)
A. postValue()
B. setValue()
C. publish()
D. Asign
AB
What are components in Room? (Choose 3 answers)
A. Entity
B. DatabaseHelper
C. Repository
D. DAO
E. All of above
ACD
What are the advantages of using a Room database? (Choose 3 answers)
A. Creates and manages an Android SQLite database for you
B. Eliminater a lot of boilerplate code
C. Helps you manage multiple backends
D. Using a DAO, provides a mechanism for mapping Java methods to database
queries
ABD
Which of the followinf are reasons for using a ViewModel? (Choose 2 answers)
A. Cleanly separates the UI from the backend
B. Often used with LiveData foe changeable data that the UI will use or display
C. Prevents rour data from being lost when the app crashes
D. Acts as a commuication center between the Repository and the UI
E. ViewModel instances survive device configuration changes
BE
Which constructor method so you use to create a new explicit Intent?
A. new Intent()
B. new Intent(Context context, Class<?> class)
C. new Intent(String action, Uri uri)
D. new Intent(String action)
B
Which subclass of Fragment displays a vertical list of items that are managed by an
adapter?
A. RowsFragment()
B. PreferenceFragment()
C. DialogFragment()
D. ListFragment()
D
How do you send data from an activity to a fragment? (Choose 2 answers)
A. Set a Bundle use the Fragment.setArguments(Bundle) method to supply the
construction arguments for the fragment
B. Use the Fragment method getArgument() to get the arguments
C. Define an interface in the Fragment class, and implement th interface in the
activity
D. Call addToBackStack() during a transaction that remove the fragment
AB
What are features of LiveData? (Choose 4 answers)
A. When Livedata is used with Room, data updates automatically if all the
intermediate levels also retrun LiveDate(DAO, ViewModel, Repository)
B. Uses the observer pattern and notifies its observers when its data has changes
C. Automatically updates the UI thn it changes
D. Is lifeccycle aware
ABCD
Which component is used to open an Activity when user taps a notification?
A. Icon that represents the action
B. Title that describes the action
C. Action button
D. PendingIntent that's sent when the user taps the action button
D
Which libraries can be used to display an image from the internet? (Choose 3
answers)
A. Picasso
B. Retrofit
C. Volley
D. Glide
ACD
To open an URL in Android application, we use
A. Explicit Intent
B. Implicit Intent
C. None of above
D. All of above
B
What are the features of Firebase? (Choose 4 answers)
A. Hosting
B. Authentication
C. Real-time Database
D. Storage
ABCD
Which of following is FALSE about RecylerView? (Choose 2 answers)
A. Adapter is not needed in RecylerView
B. It eliminates the need of ViewHolder
C. It is more efficient than listView
D. You don't need a layout manager with a RecyclerView to hanlde the hierachy and
layout of View elements
AD
Which of the following function calls can be used to start a Service from your Android
application? (Choose 2 answers)
A. bindService
B. startService
C. runService
D. launchService
AB
What is broadcast reciever in android?
A. It will react on broadcast annoucements
B. It will do background functionalities as service
C. It will pass the data between activitiese
D. All of above
A
What is the tool that is used to create an emulator to simulate the configuration of a
particular type of Android device?
A. Theme Editor
B. Android SDK Manager
C. AVD Manager
D. Virtual Editor
C
Which kernel is Android based on ?
A. Linux Kernel
B. Windows kernel
C. MAC kernel
D. Hybird Kernel
A
Which component is not under the Android application ?
A. Content Provider
B. Broadcast receiver
C. Shared Preference
D. Cloud storage
D
Which parameter specifies the Android API Level that Gradle should use to compile
your app ?
A. minSdkVersion
B. complieSdkVersion
C. targetSdkVersion
D. testSdkVersion
B
What is contained within the manifest xml file?
A. The permissions the app require
B. The list of strings used in the app
C. The source code
D. Layout
A
Which control works as a dropdownlist in Android?
A. ComboBox
B. List
C. Spinner
D. DropList
C
When is activity paused?
A. If activity is at background and still visible
B. If activity is not visible
C. If the activity is at foreground and visible
D. If the activity is at foreground
A
Which of following are Android RecyclerView layout managers? (Choose 2 answers)
A. GridLayoutManager
B. RecyclingManager
C. LinerLayoutManager
D. CircularLayoutManager
AC
Which structure do shared preference use to store data?
A. hashmap
B. key-value pair
C. built in database
D. B-Tree
B
Explain android activity life cycle?
A. onCreate() −> onStart() −> onActivityStarted() −> onResume() −>
onPause() −> onStop()
−>onActivityDistroy() −> onDestroy()
B. OnCreate() −> onStart() −>onResume() −> onPause() −> onStop()
−> onRestart() −> onDestroy()
C. OnCreate() −> onStart() −> onPause() −> onResume() −> onStop()
−> onDestroy()
D. OnCreate() −> onStart() −> onPause() −> onResume()
B
How many sizes are supported by Android?
A. Android supported all sizes
B. Android does not support all sizes
C. Android supports small,normal, large and extra-large sizes
D. Size is undefined in android
C
How to upgrade SQlite the database from a lower version to higher version in
androidSQlite?
A. Using helper Class
B. Using cursor
C. Using intent
D. None of the above
A
What are commands needed to create APK in android?
A. No need to write any commands
B. Create apk_android in command line
C. Javac,dxtool, aapt tool, jarsigner tool, and zipalign
D. None of the above
C
Which company developed android?
A. Apple
B. Google
C. Android Inc.
D. Nokia
C
Which company bought android?
A. Apple
B. No company
C. Nokia
D. Google
D
Web browser available in android is based on
A. Chrome
B. Firefox
C. Open-source Webkit
D. Opera
C
Android is based on which kernel?
A. Linux kernel
B. Windows kernel
C. MAC kernel
D. Hybrid Kernel
A
Is Android available in ROM?
A. Yes
B. No
B
Android is based on which language.
A. C
B. C++
C. VC++
D. Java
D
Which is the latest mobile version of android?
A. 3.0 (Honeycomb)
B. 2.3 (Gingerbread)
C. 2.6
D. 2.2 (Froyo)
B
What is android?
A. Desktop Operating System
B. Programming Language
C. Mobile Operating System
D. Database
C
Android doesn't support which format?
A. MP4
B. MPEG
C. AVI
D. MIDI
C
Android supports which features.
A. Multitasking
B. Bluetooth
C. Video calling
D. All of the above
D
Which of the following Dialog boxes are supported by Android?
1) AlertDialog
2) ProgressDialog
3) DatePickerDialog
4) TimePickerDialog
A. 1 and 2
B. 3 and 4
C. all of the above
D. none of these
C
If you want to increase the whitespace between widgets, you will need to use the
____________ property
A. Android:padding
B. Android:digits
C. Android:capitalize
D. Android:autoText
A
Using a content provider, which of the following operations are able to perform?
1) create
2) read
3) update
4) delete
A. 1,2,3
B. 2,3,4
C. all of the above
D. none of these
C
Which of the following don't have any UI component and run as a background
process?
A. Services
B. Simulator
C. Emulator
D. none of these
A
An Android SDK is required to develop the application for Android.
A.Yes
B. No
A
Which of the following holds Java source code for the application?
A.res/
B.assets/
C.src/
D.bin/
C
Which of the following(s) is/are component of APK file?
A. Resources
B. Delvik Executable
C. both a and b
D. none of above
C
Typically MIME type will be
A.html
B.text
C.Text/HTML
D.Doc
C
Eclipse is an ________
A. Android tool
B. IDE
C. Android interface
D. none of these
B
To update contents of content provider using curser and commit you need to
call________
A.commitUpdates()
B.updates()
C.commit()
D.none of these
A
26. insert data into a content provider, you need to use______
1) insert()
2) bulkInsert()
3) getContentProvider()
4) update()
A. 1 and 2
B. 3 and 4
C. all of the above
D. none of these
A
What is mean by ANR?
A. Application not Recognized
B. Android not recognized
C. Application Not Responding
D. none of these
C
ADB stands for
A. Android Debug Bridge
B. Application Debug Bridge
C. Android data bridge
D. Application data bridge
A
In ___________, sender specifies type of receiver.
A. Implicit intent
B. Explicit intent
C. A and B
D. Any activity
A
30. Which of the following are different storage methods available in Android?
1) Shared Preferences
2) Internal Storage
3) External Storage
4) SQLite Databases
5) NetworkConnection
6) Intermediate storage
A. 1,2,3,4,6
B. 2,3,4,5,6
C. 1,2,3,4,5
D. 1,2,3,4,5,6
C
For creating user interface in Android, you have to use
A. Eclipse
B. java and XML
C. java and SQL
D. Java and Pl/sql
B
Android provides a few standard themes, listed in__________
A. R.style
B. X.style
C. menifeest.XML
D. application
A
For __________ , code used by Android is not a open source
A. Device driver
B. video driver
C. WiFi driver
D. Bluetooth driver
C
What is an anonymous class in android?
A. Interface class
B. A class that does not have a name but have functionalities in it
C. Java class
B
What are return types of startActivityForResult() in android?
A. RESULT_OK
B. RESULT_CANCEL
C. RESULT_CRASH
D. A and B
D
What is an activity in Android?
A. Activity performs the actions on the screen
B. Manage the Application content
C. Screen UI
D. None of the above
A
____ object allows to modify the preference values
A. Preferences.Editor
B. Preferences.Modificator
C. SharedPreferences.Editor
D. SharedPreferences.Modificator
C
Which of following methods is used to launch an activity for which you would like
aresultwhen it
finished?
A. startActivity()
B. startActivityForResult()
C. startActivityIfNeeded ()
D. startIntentSender()
B
PendingIntent is used to grant to another application the right to performthe
operation that specified as if the other application was in current app.
A.True
B. False
A
Identify two ways to execute a delete statement, in SQLite: (db is instance of
SQLiteDatabase class) (Choose 2 answers)
A. To execute db.delete method
B. To execute db.execSQL method
C. To execute db.update method
D. To execute db.exec method
AB
Which of followings provides the getLatitude and getLongitude methods?
A. LocationManager
B. All of others
C. Location
D. Map
C
_____ are asynchronous messages which allow Android components to request
functionality from other components of the Android system
A. Messages
B. Filters
C. Activities
D. Bundles
E. Intents
E
What is the persistence mechanism that allows to sort and retrieve quickly large
datasets and can easily be used to store customized data?
A. Persistent Storage
B. Android File API
C. Shared Preferences
D. SQLite
D
A broadcast receiver will be able to receive intents which can be generated via
the_____method
A. Context.broadcast()
B. Context.startBroadcast()
C. Context.sendBroadcast()
D. Context.notify ()
C
Consider the file object:
InputStream in = null;
Which one of followings can be used to create in object?
A. in = openFileInput( "myfile", MODE_WORLD_READABLE);
B. in = openFileInput( "myfile", MODE_PRIVATE);
C. in = openFileInput( "myfile");
D. in = new InputStream( "myfile", MODE_WORLD_READABLE);
D
_____ class exposes methods to manage a SQLite database.
A. SQLiteQueryBuild
B. SQLiteOpenHelper
C. SQLiteDatabase
D. SQLiteProgram
C
Intent is used to grant to another application the right to perform the operation that
specified as if the other application was in current app.
A. True
B. False
B
The openFile () method opens a named file for writing, with the mode specified.
A. True
B. False
B
Identify the correct statements about a task in Android:
A) A task is a collection of related applications.
B) A task is capable of spanning multiple processes.
A. B is correct
B. Both are incorrect
C. Both are correct
D. A is correct
A
Which of following permissions needs to specify when using the Network location
service?
A. android.permission.INTERNET
B. All of others
C. android.permission.ACCESS_FINE_LOCATION
D. android.permission.ACCESS_COARSE_LOCATION
D
HTML5 Canvas supports for event handlers
A. True
B. False
B
____ class provides the onCreate() and onUpgrade() methods to manage database
creation and version management.
A. SQLiteOpenHelper
B. Cursor
C. ContentValues
D. Bundle
E. SQLiteDatabase
A
What are the advantages of using SVG over other image formats (like JPEG and
GIF)? (Choose 3 answers)
A. SVG images can be created and edited with any text editor
B. SVG images can be searched, indexed, scripted, and compressed
C. SVG images can be printed with high quality at any resolution
D. SVG images are rendered fast.
ABC
What do the developers need to apply for before they can integrate Google Maps
intoyourAndroid application?
A. a free Google Maps API
B. All of others
C. a free developer key
D. a free Google Maps API key
E. None of others
D
Google Maps is provided via Google Play library.
A. True
B. False
A
Which of following methods is used to access a view component?
A. None of others
B. findViewById
C. createViewById
D. getViewById
B
The ______ method is typically used to commit unsaved changes to persistent data,
stop animations and other things that may be consuming CPU, and so on
A. onPause
B. onStop
C. onResume
D. onDestroy
A
In SQLite, result sets of queries are returned in _____ objects.
A. ResultSet
B. Cursor
C. Table
D. DataSet
B
Identify the correct statements about a task in Android:
A) A task is a collection of related Activities.
B) A task is capable of spanning multiple processes.
A. A is correct
B. B is correct
C. Both are correct
D. Both are incorrect
C
Which one of the activity lifecycle's callback methods is called just before the activity
starts interacting with the user?
A. onPause
B. onCreate
C. onStop
D. onStart
E. onResume
E
Which of followings provides a simple but powerful app architecture that leverages
the Model View Controller (MVC) pattern?
A. Android
B. jQuery
C. Sencha Touch
D. PhoneGap
C
What the file format is executed by Dalvik VM?
A. .and
B. .java
C. .exe
D. .class
E. .dex
E
In the Sensor Framework, ____ provides various methods that let you determine a
sensor's capabilities.
A. SensorManager
B. SensorEvent
C. Sensor
D. SensorEventListener
C
Which of followings is the recommended unit of measurement when specifying the
dimension of views in your layout?
A. px
B. pt
C. sp
D. dp
D
Which one is different from others?
A. TextView
B. ListView
C. Spinner
D. EditText
D
When the first of an application's components needs to be run, Android starts a Linux
process for it with a single thread of execution called ______
A. UI thread
B. Normal thread
C. Runnable thread
D. Diamon thread
A
Which one of the followings contains Core libraries in Android architecture?
A. Libraries
B. Application Framework
C. Linux kernel
D. Android runtime
D
Which ones are correct statements about the Android service?
A. None of others
B. Another application component can start a service and it will continue to run in the
background even if the user switches to another application
C. All of others
D. A " ttp://devel per.andro d.co /re erence/ ndroid/app/S rvice.html erv ce is an ppl
cati n c mponent t at c n perform
E. A service runs in the main thread of its hosting process—the service does not
create its own thread and does not run in a separate process
C
Which of followings likes the dropdown menu?
A. ListView
B. GridView
C. Switch
D. Spinner
D
Which of following Android PhoneGap project folders should be used to put all
PhoneGap Javascript library files?
A. assets
B. src
C. bin
D. res
E. libs
A
Which one of following statements is incorrect about the Thread?
A. The main thread is also sometimes called the UI thread.
B. Everything that is happening in the main thread, performing long operations such
as network access or database queries will block the whole UI.
C. View can be accessed from outside the main thread
D. The Andoid UI toolkit is not thread-safe.
C
Which of following values of android:layout_height property tells a view to size itself
to the dimensions required by its content?
A. fill_parent
B. wrap_content
C. All of others
D. match_parent
B
Which one of the followings contains Dalvik Virtual Machine in Android architecture?
A. Libraries
B. Linux kernel
C. Application Framework
D. Android runtime
D
Which of followings is used to register for listening an event with the Android
system?
A. BroadcastReceiver
B. IntentReceiver
C. EventListener
D. ActionListener
A
_____ is called when the activity is no longer visible to the user
A. onRestart
B. onStop
C. onResume
D. onStart
E. onCreate
F. onPause
B
A _____ is an application in Android that runs in the background without needing to
interact with the user
A. AsynTask
B. Thread
C. Fragment
D. Service
D
In Android, the ____ method of ____ class to return the full path to the external
storage.
A. getExternalStorageDirectory(), File
B. getExternalStorageDirectory(), Environment
C. getExternalStorageDirectory(), Context
D. getExternalStorageDirectory(), System
B
Which of following values of android:layout_width property tells a view to size itself to
the dimensions required by its content?
A. fill_parent
B. All of others
C. match_parent
D. wrap_content
D
In Google Map Android API, a GoogleMap object cannot be instantiated directly.
A. True
B. False
A
Two Android applications can interact with other by ____
A. Activity
B. Service
C. Intent
D. RPC
E. Content Provider
C
____ are also ideal for situations in which there is no need to present a UI to the
user.
A. Services
B. Threads
C. Activities
D. AsynTasks
A
Which of following properties set a number to specify the proportional size?
A. android:layout_gravity
B. android:layout_height
C. android:layout_width
D. android:layout_weight
D
Which of followings is NOT the broad categories of sensors in the Android?
A. Motion sensors
B. Network sensors
C. Position sensors
D. Environmental sensors
B
What is Android?
A. Android is a stack of software's for mobility
B. Google mobile device name
C. Virtual machine
D. None of the above
A
What is the life cycle of services in android?
A. onCreate()−>onStartCommand()−>onDestory()
B. onRecieve()
C. Final()
D. Service life cycle is same as activity life cycle.
A
What is singleton class in android?
A. A class that can create only one object
B. Anonymous class
C. Java class
D. Manifest file
A
What is breakpoint in android?
A. Breaks the application
B. Breaks the development code
C. Breaks the execution
D. None of the above.
C
In which technique, we can refresh the dynamic content in android?
A. Java
B. Ajax
C. Android
D. None of the Above
B
What is sandbox in android?
A. Each application runs securely in sandbox without interrupting another process
B. Android Box
C. Android development tool kit
D. None of the above
A
How many protection levels are available in the android permission tag?
A. There are no permission tags available in android
B. Normal, kernel, application
C. Normal, dangerous, signature, and signatureOrsystem
D. None of the above
C
What is a thread in android?
A. Same as services
B. Background activity
C. Broadcast Receiver
D. Independent dis-patchable unit is called a thread
D
Android tries hard to ______________ low level components, such as the software
stack, with interfaces so that vendorspecific codecan be managed easily.
A. confound
B. abstract
C. modularize
D. compound
B
What is a key difference with the distribution of apps for Androidbased devices than
other mobile device platform applications?
A. Applications are distributed by Apple App Store only
B. Applications are distributed by multiple vendors with different policies
onapplications.
C. Applications are distributed by multiple vendors with the exact same policieson
applications.
D. Applications are distributed by the Android Market only.
B
When developing for the Android OS, Java byte code is compiledinto what?
A. Java source code
B. Dalvik application code
C. Dalvik byte code
D. C source code
C
What does the .apk extension stand for?
A. Application Package
B. Application Program Kit
C. Android Proprietary Kit
D. Android Package
A
Which of these are not one of the three main components of theAPK?
A. Dalvik Executable
B. Resources
C. Native Libraries
D. Webkit
D
What is the name of the program that converts Java byte code intoDalvik byte code?
A. Android Interpretive Compiler (AIC)
B. Dalvik Converter
C. Dex compiler
D. Mobile Interpretive Compiler (MIC)
C
Android Applications must be signed.
A. After they are installed
B. Before they are installed
C. Never
D. Within two weeks of installation
B
Which of the following are not a component of an APK file?
A. Resources
B. All of these are components of the APK
C. Native Libraries
D. Dalvik executable
B
The AWT and Swing libraries have been removed from theAndroid library set.
A. True
B. False
A
The R.java file is where you edit the resources for your project.
A. True
B. False
B
What is contained within the Layout xml file?
A. Orientations and layouts that specify what the display looks like
B. The permissions required by the app
C. The strings used in the app
D. The code which is compiled to run the app
A
The emulated device for android.
A. Runs the same code base as the actual device, all the way down to the
machinelayer
B. Is more of a simulator, and acts as a virtual machine for the Android device
C. Runs the same code base as the actual device, however at a higher level
D. An imaginary machine built on the hopes and dreams of baby elephants
A
The Emulator is identical to running a real phone EXCEPT whenemulating/simulating
what?
A. Telephony
B. Applications
C. Sensors
D. The emulator can emulate/simulate all aspects of a smart phone.
C
The R file is a(an) generated file
A. Automatically
B. Manually
C. Emulated
D. None of the above
A
An activity can be thought of as corresponding to what?
A. A Java project
B. A Java class
C. A method call
D. An object field
B
To create an emulator, you need an AVD. What does it stand for?
A. Android Virtual Display
B. Android Virtual Device
C. Active Virtual Device
D. Application Virtual Display
B
The Android SDK ships with an emulator.
A. True
B. False
A
The ___________ file specifies the layout of your screen.
A. Layout
B. Manifest file
C. Strings XML
D. R file
A
The manifest explains what the application consists of and glueseverything together.
A. True
B. False
A
The Android Software Development Kit (SDK) is all you need todevelop applications
for Android.
A. True
B. False
A
What is the driving force behind an Android application and thatultimately gets
converted into a Dalvik executable?
A. Java source code
B. Rfile
C. the emulator
D. the SDK
A
While developing Android applications, developers can test theirapps on...
A. Emulator included in Android SDK
B. Physical Android phone
C. Thirdparty Emulators (Youwave, etc.)
D. All three options will work
D
What file is responsible for glueing everthing together , explainingwhat the applicatin
consists of, what its main building blocks are,ext...?
A. Layout file
B. Strings XML
C. R file
D. Manifest file
D
The XML file that contains all the text that your application uses.
A. stack.xml
B. text.xml
C. strings.xml
D. string.java
C
Which of the following is the most "resource hungry" part ofdealing with Activities on
Android
A. Closing an app
B. Suspending an app
C. Opening a new app
D. Restoring the most recent app
C
What runs in the background and doesn't have any UIcomponents?
A. Intents
B. Content Providers
C. Services
D. Applications
C
What is an Activity?
A. A single screen the user sees on the device at one time
B. A message sent among the major building blocks
C. A component that runs in the background without any interface
D. Context referring to the application environment
A
When an activity doesn't exist in memory it is in.
A. Starting state
B. Running state
C. Loading state
D. Inexistent state
A
Which of the following is NOT a state in the lifecycle of a service?
A. Starting
B. Running
C. Destroyed
D. Paused
D
There is no guarantee that an activity will be stopped prior to beingdestroyed.
A. True
B. False
A
Intents
A. are messages that are sent among major building blocks
B. trigger activities to being, services to start or stop, or broadcast
C. are asynchronous
D. all of these
D
In an explicit intent, the sender specifies the type of receiver.
A. True
B. False
B
An implicit intent is the sender specifies the type of receiver?
A. True
B. False
A
When the activity is not in focus, but still visible on the screen it is in?
A. running state
B. Paused state
C. stopped state
D. destroyed state
B
An activity in a stopped state is doing nothing.
A. True
B. False
B
Application contexts are independent of the activity life cycle.
A. True
B. False
A
Services have any user interface components
A. True
B. False
B
Broadcast receivers are Android's implementation of a system wide
publish/subscribe mechanism, or more precisely, what design pattern?
A. Observer
B. Facade
C. Mediator
D. Command
A
There can be only one running activity at a given time.
A. True
B. False
B
Lists and adapters are more organizational aids than userinterface elements in
Android.
A. True
B. False
A
What builtin database is Android shipped with?
A. SQLite
B. Apache
C. MySQL
D. Oracle
A
Creating a UI (User Interface) in Android requires careful use of...
A. Java and SQL
B. XML and Java
C. XML and C++
D. Dreamweaver
B
App Widgets are can be place on the home screen by the user tocheck for updates
are available?
A. True
B. False
A
The android OS comes with many useful system services, whichinclude processes
you can easily ask for things such as your...
A. All of these and more
B. Location
C. Sensor Readings
D. WiFi, Hot Spots
A
What does the Gargenta mean in his Design Philosophy when hesays that the
project will, "Always be whole and complete"?
A. He means that when we finish the entire project we will have a working
application, even though there will be points along the way when we will stop andthe
application will not run.
B. He means that the program must always be able to compile.
C. He means that we will work on the program by adding self contained chunks toit
so that at every stopping point the application runs as though it were a wholeand
complete application. Each additional chunk simply adds a new functionality to the
application.
D. None of the above
C
An Android application is a loose collection of content providers,activities, broadcast
receivers, and services.
A. True
B. False
A
The timeline receiver will receive messages from the Androidsystem.
A. True
B. False
B
Status data will be exposed to the rest of the Android system via:
A. Intents
B. A content provider
C. Network receivers
D. Altering permissions
B
If the UI begins to behave sluggishly or crash while makingnetwork calls, this is likely
due to...
A. Network latency
B. Hardware malfunctions
C. Virus on the Server
D. Activity manager contains too much.
A
Which source of documentation is the official documentation for Android developers?
A. stackoverflow.com
B. offialandroid.blogspot.com
C. github.com
D. developer.android.com
D
Which of following methods is used to launch an activity for which you would like a
result when it finished?
A. startActivity()
B. startActivityForResult()
C. startActivityIfNeeded ()
D. startIntentSender()
B
Assume that your app includes this logging statement:Log.i("MainActivity",
"MainActivity layout is complete");. You see the statement "MainActivity layout is
complete" in the Logcat panel. Which of the following log level menu is set? (Choose
2 answers)
A. Verbose
B. Debug
C. Info
D. Warn
E. Error
AC
Which of the following are true statements about the Android apps? (Choose 2
answers)
A. The bulk of these apps are written in C/C++
B. The bulk of these apps are written in Java
C. It's possible to write portions of the apps in C/C++
D. These apps cannot be written in C/C++
BD
Where do not we need permission to store data? (Choose 2 answers)
A. shared preferences
B. internal storage
C. external storage
D. SD card
AB
Which layout has android:layout_alignParentTop attribute?
A. LinearLayout
B. RelativeLayout
C. CoordinationLayout
D. FrameLayout
B
What is the difference between themes and styles?
A. Themes apply to the entire app, while you can apply styles to specific views
B. Themes cannot inherit from other themes, but styles can inherit from other styles
C. Styles cannot inherit from other styles, but themes can inherit from other themes
D. Themes are provided by the Android system, while styles are defined by the
developer
A
What is the correct signature for a method used with the android:onClick XML
attribute?
A. public void callMethod()
B. public void callMethod(View view)
C. private void callMethod(View view)
D. public boolean callMethod(View view)
B
Which of the following should be used to save the unsaved data and release
resources being used by an Android application?
A. Activity.onStop()
B. Activity.onPause()
C. Activity.onDestroy()
D. Activity.onShutdown()
E. Activity.onFreeze()
C
Which of the following correctly describe what an intent is in Android?
A. A massage that provides a screen within which users can interact in order to do
something
B. A component that runs in the background to perform long-running operations or
access remote resources
C. An event handler that responds to system-side broadcast announcements
D. A message that describes an action to perform or an event that has occurredD
D
Which component is changed significantly from Android 6.0?
A. Storage
B. Permission
C. Database
D. BroadcastReceiver
B
Which of the following is NOT true about fragments?
A. A fragment has its own lifecycle and receives its own input events
B. It is not possible to remove a fragment while the activity is running
C. A fragment is defined in a Kotlin class
D. A fragment's Ul is defined in an XML layout file
B
Which component should we use to share the data across all applications?
A. Shared Preferences
B. Content provider
C. Intemal Storage
D. SQLite Databases
B
Which of the following statements are true for an "implicit' intent?
A. The category must not be specified
B. The name must not be specified
C. The action must not be specified
D. The data must not be specified
B
Which method can you call to shut down an activity?
A. fnishActivity
B. finish()
C. destroy()
D. stop()
B
When an Activity start interacting with the user which Activity Life Cycle method is
invoked by the system
A. onRestart
B. onstop
C. onResume
D. onPause
C
Which of the following are the valid usages of Intents in Android? (Choose 3
answers)
A. Start an Activity
B. Start a SQLite DB Connection
C. Start a Service
D. Delivery a Broadcast receiver
ACD
Which components are Android basic application components? (Choose 2 answers)
A. Activity
B. Content provider
C. RecyclerView
D. Fragment
AB
Which buttons does the Basic Activity template provide as part of the UI?
A. Navigation buttons
B. Options menu overflow button
C. Floating action button
D. Button class button with the text "Button"
B
You can show or hide a view in your app by setting its visibility.
Which of the following are valid visibility values? (Choose 3 answers)
A. VISIBLE
B. GONE
C. CLEAR
D. INVISIBLE
ABD
Is a View also known as a Widget in Android?
A. True
B. False
C. Can be true or false
A
What Activity lifecycle methods are called when a device-configuration change (such
as rotation) occurs?
A. Android immediately shuts down your Activity by calling onStop(). Your code must
restart the Activity
B. Android shuts down your Activity by calling onPause(), onStop(), and onDestroy().
Your code must restart the Activity.
C. Android shuts down your Activity by calling onPause(), onStop(), and onDestroy(),
and then starts it over again, calling onCreate), onStart(), and onResume()
D. Android immediately calls onResume()
C
Which of the following correctly describe benefits that an intent provides to apps in
Android? (Choose 2 answers)
A. Anintent manages secure access to structured data |
B. An intent simplifies app development since existing components can be reused as
"black-boxes"
C. A intent s the "glue" that helps integrate Android apps.
D. A intent dfines the smallest it of execution for sequences of programmed
instructions
BC
Which of the following correctly describe what Android's IntentService does?
(Choose 2 answers)
A. It is a companent that providesa screen within which users can iteract i order to do
something
B. It expresses requests as intents & passes them between threads and/or
processes
C. It's a framework that handles asynchronous requests on demand
D. It is an event handler that responds to system-side broadcast announcement
BC
Which of the following are methods in the activity and fragment lifecycles? (Choose 3
answers)
A. onCreate()
B. onDraw()
C. onClick()
D. onStart()
E. onPause()
ADE
Which method is called when the map is loaded and ready to be used in the app?
A. onMapReady(GoogleMap)
B. onMapLoaded(GoogleMap)
C. onMapCreate(GoogleMap)
D. onMapInitialize(GoogleMap)
A
What are the two key things Retrofit needs to build a web-services API?
A. The base URI for the web service and a GET query
B. The base URI for the web service and a converter factory
C. A network connection to the web service and an authorization token
D. A converter factory and a parser for the response
B
What is broadcast receiver in android?
A. It will react on broadcast announcements
B. It will do background functionalities as services.
C. It will pass the data between activities
D. None of the Above
A
To report progress of the work executed by an AsyncTask, what callback method do
you implement, and what method do you call in your AsyncTask subclass?
A.Implement publishProgress().Call publishProgress()
B.Implement publishProgress().Call onProgressUpdate()
C.Implement onProgressUpdate().Call publishProgress()
D.Implement onProgressUpdate().Call onProgressUpdate()
C
Which folder is for XML files that contains strings, integers, and colors?
A. res/layout
B. res/mipmap
C. res/raw
D. res/values
D
Which of the following are elements in an Android intent? (Choose 3 answers)
A. Data
B. Action
C. URL
D. Extras
E. Flags
ABE
Which of the following are reasons why the SQLite query() method returns a Cursor?
A. It allows buffering of query results
B. It is efficent since data needn't be loaded into memory
C. It ensures that query results are right
D. It alleviates the need to explicitly call close() on the Cursor
D
Android Architecture Components provide some convenience annotations for DAOs.
Which of the following are available? (Choose 4 answers)
A. @Query
B. @Insert
C. @Delete
D. @Update
E. @Select
ABCD
Which Intent action do you use to take a picture with a camera app?
A. Intent takePicture=new Intent(Intent ACTION VIEW)
B. Intent takePicture = new Intent(Intent.ACTION MAIN)
C. Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE)
D. Intent takePicture = new Intent(Intent.ACTION_GET_CONTENT)
C
Which of the following are Ul elements that you can use in a window in an Android
application? (Choose 2 answers)
A. TextBox
B. TextView
C. EditText
D. LabelView
BC
Which of the following are true statements about implicit and explicit intent? (Choose
3 answers)
A. Android delivers an explicit intent to a target component without consulting filters
in the AndroidManifest.xml file
B. Implicit intents are typically used to interact with components residing in other
apps
C. Explicit intents are typically used to interact with components residing in other
apps
D. Android delivers an implicit intent to a target component only if it matches one of
its intent filters in the AndroidManifest.xml file
ABD
What is the name of the layout file for the main activity?
A. MainActivity.java
B. AndroidManifest.xml
C. activity_main.xml
D. build.gradle
C
How to store heavy structured data in android?
A. Shared Preferences
B. Cursor
C. SQlite database
D. Not possible
C
How does RecyclerView display items? (Choose 3 answers)
A. It displays items in a list or a grid
B. It scrolls vertically or horizontally
C. It scrolls diagonally on larger devices, such as tablets
D. It allows custom layouts
ABD
Which of the following are layout managers provided by Android? (Choose 3
answers)
A. LinearLayoutManager
B. GridLayoutManager
C. CircularLayoutManager
D. StaggeredGridLayoutManager
ABD
Which component handle background processing associated with an application?
A. Activities
B. Services
C. Broadcast Receivers
D. Content Providers
B
How do you add a query option to a REST web-service call in Retrofit? (Choose 2
answers)
A. Append the query to the end of the request URL
B. Add a parameter for the query to the function that makes the request and
annotate the parameter with @Query
C. Use the Query class to build a request
D. Use the addQuery() method in the Retrofit builder
AB
When in the Activity lifecycle is onSavelnstanceState() called?
A. onSavelnstanceState() is called before the onStop() method
B. onSavelnstanceState() is called before the onResume() method
C. onSavelnstanceState() is called before the onCreate() method
D. onSavelnstanceState() is called before the onDestroy() method
A
Which of the following are types of Android intent broadcast mechanisms? (Choose
2 answers)
A. Dynamic
B. Ordered
C. Static
D. Normal
BD
Which of the following statements is true about ViewHolder?
A. An adapter can use multiple ViewHolder classes to hold headers and various
types of data
B. You can have exactly one view holder for data and one view holder for a header
C. A RecyclerView supports multiple types of headers, but the data has to be
uniform
D. When adding a header, you subclass RecyclerView to insert the header at the
correct position
A
Which tag is used to define themes?
A. <style>
B. <theme>
C. <meta-tag>
D. <styling>
A
Which changes are made when you add a second Activity to your app by choosing
File> New > Activity and an Activity template?
A. The second Activity is added as a Java class. You still need to add the XML
layout file
B. The second Activity XML layout file is created and a Java class added. You still
need to define the class signature
C. The second Activity is added as a Java class, the XML layout file is created, and
the AndroidManifest.xml file is changed to declare a second Activity
D. The second Activity XML layout file is created, and the AndroidManifest.xml file is
changed to declare a second Activity
C
Which of the following statements sets the title for an alert dialog?
A. myAlertBuilder.setMessage("Alert")
B. myAlertBuilder.setPositiveButton("Alert")
C. myAlertBuilder.setTitle("Alert")
D. AlertDialog.Builder myAlertBuilder = new AlertDialog.Builder("Alert")
C
Which method is used to add a marker to google maps?
A. setMarker
B. addMarker
C. setPoint
D. addPoint
B
Which lifecycle method is called to make an activity visible?
A. onPause()
B. onVisible()
C. onDestroy()
D. onStart()
D
Which constructor method do you use to create an implicit Intent to launch a camera
app?
A. new Intent()
B. new Intent(Context context, Class<?> class)
C. new Intent(String action, Uri uri)
D. new Intent(String action)
D
What is the name of the file in which you create options menu items?
A. menu.java
B. menu_main.xml
C. activity_main.xml
D. content_main.xml
B
Which of the following statements accurately reflect what happens when a user
enters text via the Android virtual keyboard?
A. The onStart() hook method is called back and the activity becomes visible
B. The onResume() hook method is called back to return UI focus for this screen
C. The UI focus is unchanged and no lifecycle hook methods are called
D. A new activity is started and its onCreate() hook method is called
A
Suppose you want to create an app that has a white background, dark text, and a
dark action bar. Which base style does your application style inherit from?
A. Theme.AppCompat Light
B. Theme.AppCompat Dark NoActionBar
C. Theme.AppCompat.Light.DarkActionBar
D. Theme AppCompat NoActionBar
B
Which permission should Android app use when the app wants to track phone's
precise location?
A. android.permission ACCESS_FINE_LOCATION
B. android.permission.ACCESS_COARSE_LOCATION
C. android.permission.ACCESS_LOCATION
D. android.permission. INTERNET
A
PT1=Q1=What is AVD?
A. Android Virtual Display
B. Android Virtual Device
C. Active Virtual Device
D. Application Virtual Display
B
PT1=Q2=In a ConstrainLayout, which of the following contraints are needed to
position a view onscreen?
A. There is no need to constraint the view
B. Two horizontal constraints
C. One vertical constraint
D. At least one horizental and one vertical constraint
D
PT1=Q3=For EditText views, it's not a good practice to provide hints because hints
clutter the input field. True or false?
A. True
B. False
B
PT1=Q4=All layout classes are the subclasses of____________
A. android.widget
B. None
C. android.view.ViewGroup
D. android.view.View
C
PT1=Q5=All ViewGroup classes are subclasses of which of the following?
A. android.view.Layout
B. android.widget
C. None
D. android.view.View
C
PT1=Q6=How can we kill an activity in android?
A. Neither (1) nor (2)
B. 2) Using finishActivity(int requestCode)
C. Both (1) and (2)
D. 1) Using finish() method
C
PT1=Q7=Which of the following callback is called when an activity starts interacting
with the user?
A. onDestroy
B .onStop
C. onResume
D. onCreate
C
PT1=Q8=Each Android application runs in its own process and with its own instance
of ART on devices running Android version 8.0 (APl Level 26) or higher
A. True
B. False
A
PT1=Q9=Which of the following choices is the best answer to fll the empty space in
the following sentence?
Adding a new color to the colors xmi file in Android Studio Ures Values/colors.xmi )
helps the app developers to use this new color as text color attribute value for the
_______ attribute in all these app layouts.
A. color:textformat
B. android:textColor
C. Kotlin:textcolor
D. java:textcolor
B
PT1=Q10=Which of the following choices is the recommended syntax to change the
font size to 18?
A. android:textSize="18pt"
B. android:textSize="18dip"
C. android:textSize="18sp"
D. android:textSize="18dp"
C
PT1=Q11=Which of the below choices is the best answer to fill the empty space in
the following sentence?
If you want to give all text widgets in an app the same format such as font color, font
size, and font family, you should add the style attribute to the TextView XML tags in
layout file and set the attribute value to the same style name. You should define that
style by adding a new style tag inside _____
A. AndroidManifest.xml file
B. styles.xml file
C. activity_main.xml file
D. MainActivity.java or MainActivity.kt file
B
PT1=Q12=To configure your style as the theme for all your app activities (entire
app), open AndroidManifest.xml, and set the theme by adding
android:theme="@style/your_style_name" attribute to the _________
A. <activity> tag
B. <intent-filter> tag
C. <manifest> tag
D. <application> tag
D
PT1=Q13=Android SDK platform is a set of libraries and APIs that provide necessary
classes, methods and interfaces to develop Android applications and allow you to
compile your code.
A. True
B. False
A
PT1=Q14=To preserve the visible size of your Ul on screens with different densities,
you must design your Ul using density-(A) _______ pixels (dp) as your unit of
measurement. One dp is a virtual pixel unit that's roughly equal to one pixel on a (B)
_______ -density screen (160dpi: the "baseline" density). Android translates this
value to the appropriate number of real pixels for each other density.
A. A independent, B normal
B. A independent, B medium
C. A independent, B high
D. A resolution, B medium
B
PT1=Q15=What is resource in Android?
A. Static content and the additional files that you code uses
B. Converts the code into APK
C. None of these
D. It's used to handle API
A
PT1=Q16=What is the purpose of super.onCreate in android?
A. It allows the developers to write the program
B. To create an activity
C. None of these
D. To create a graphical window for subclass
D
PT1=Q17=Resource Manager is used for?
A. Allows applications to display alerts and notifications to the user
B. Provides access to non-code embedded resources such as strings, color settings
and user interface layouts
C. Allows applications to publish and share data with other applications
D. Controls all aspects of the application lifecycle and activity stack
B
PT1=Q18=Which of the following is not a layer in Android Architecture?
A. Android real time
B. Application Framework
C. Linux kernel
D. Libraries
A
PT1=Q19=The root element of AndroidManifest.xml is:
A. action
B. application
C. manifest
D. activity
C
PT1=Q20=Which is NOT state of and activity?
A. Stopped
B. Active
C. Stored
D. Paused
C
PT1=Q21=Paused is used
A. If the activity is not visible
B. If the activity is at the foreground and visible
C. If the activity is at the foreground
D. If the activityis at the background and still visible
D
PT1=Q22=What is NOT an activity lifetime?
A. Visible lifetime
B. Background lifetime
C. Entire lifetime
D. Foreground lifetime
B
PT1=Q23=Which one is a touch action?
A. ACTION_MOVING
B. ACTION PRESS
C. ACTION_MOVE
D. ACTION_TAP
C
PT1=Q24=Which is NOT a callback method for event listener
A. onTouchListener()
B. onClickedListener()
C. onLongClickListener()
D. onClickListener()
B
PT1=Q25=If you want to increase the whitespace between widgets, you will need to
use the _____ property
A. Android:distance
B. Android:text-align
C. Android:margin
D. Android:autoText
C
PT1=Q26=_____ represents a single user interface screen
A. Activity
B. Fragment
C. Layout
D. View
A
PT1=Q27=Specify the directory name where the XML layout files are stored:
A. /src
B. /res/layout
C. /assets
D. /res/values
B
PT1=Q28=Android is based on which kernel?
A. Linux kernel
B. MAC kernel
C. Windows kernel
D. Hybrid Kernel
A
PT1=Q29=Which one is NOT an Android layout?
A. RectangleLayout
B. GridLayout
C. ConstraintLayout
D. FrameLayout
A
PT1=Q30=Which one is make the size of an element in the layout fit with the
children of its?
A. match-parent
B. fixed
C. wrap-constraint
D. wrap-content
D
PT2=Q1=A service can handle:
A. performfile I/O
B. interact with a content provider
C. network transactions
D. play music
ABCD
PT2=Q2=A handler can recieve messages from many _____ threads, and update
user interface
A. Main Thread
B. Worker thread
C. Ul thread
A
PT2=Q3=When use a recycler view, before set adapter for the recycler, you must:
A. setLinearManager
B. setManagerLayout
C. setLayoutManager
B
PT2=Q4=Which statement is not a method of Asyntask?
A. onProgressUpdate
B. doOnBackground
C. onPreExecute
D. onPostExecute
B
PT2=Q5=When use asyntask, we can update Ul on below methods:
A. onProgressUpdate
B. onPreExecute
C. onPostExecute
D. dolnBackground
ABC
PT2=Q6=Which statement is not allowed on the below block ?
Thread t = new Thread(new Runnable() {
@Override public void run() {
try{
synchronized (this){
wait(1000);
Toast.makeText(getApplicationContext(), "Thread running",
Toast.LENGTH_LONG).show();
}
}catch (InterruptedException e) { e.printStackTrace(); }};
t.start();
A. synchronized.statment
B. All statements are allowed
C. Toast statment
D. wait statment
A
PT2=Q7=How to pass an object to other activity?
A. object extends Serializable putExtra object to intent
B. only putExtra object to intent
C. object have to implements Serializable, then putExtra object to intent
D. Can't pass object by intent
C
PT2=Q8=Which method is called first when press to soft back button of android
device?
A. finish()
B. destroyActivity()
C.endActivity()
A
PT2=Q9=When use implicit intents. If there's more than one app that can handle the
intent, the system will:
A. presents the user with a dialog to pick which app to use
B. application crash
C. show an error dialog
A
PT2=Q10=When set small icon for a notification, what happen when we use icon
format .xm|?
A. The iconis displayed normally
B. The icon is not displayed
C. Android studio will show error statement
A
PT2=Q11=One pair thread - handler can replace by an asyntask ?
A. True
B. False
A
PT2=Q12=Explicit intents allows a component from another app to handle it
A. True
B. False
A
PT2=Q13=Explicit intents is only used to start activities?
A. True
B. False
A
PT2=Q14=This statement is correct or not:
The RecyclerView can display the list of items by vertical, horizontal and grid Iayout
A. True
B. False
A
PT2=Q15=An application listens for specific broadcast intents by registering a
_______?
A. BroadcastDetector
B. BroadcastReceiver
C. None of the others
D. BroadcastListener
B
PT2=Q16=RecyclerView provides a choice of three built-in layout:
A. FramelLayout, GridLayout, ConstraintLayout
B. LinearLayout, FrameLayout, StaggredGridLayout
C. ConstraintLayout, GridLayout, StaggredGridLayout
D. LinearLayout, GridLayout, StaggredGridLayout
D
PT2=Q17=Which statement is used to launch Main2Activity?
A. intent.startActivity(intent);
B. intent.startActivity(Main2Activity);
C. this.startActivity(intent);
D. this.startActivity(Main2Activity.class);
C
PT2=Q18=Which statement is used to pass a string to another activity?
A. intent.putData("key", "text");
B. intent.putString("key", "text");
C. intent.putExtras("key", "text");
D. intent.putExtra("key", "text");
D
PT2=Q19=Which method using to return data from sub-activity to main-activity?
A. public void receiveData() {}
B. protected void onActivityResult(int requestCode, int resultCode, Intent data){}
C. public void finish() {}
D. public void returnDatal() {}
C
PT2=Q20=Thread handlers are implemented in the main thread of an application
and are primarily used to make updates to the _________ in response to messages
sent by other threads running within the application's process.
A. user interface
B. process
C. data
D. thread
A
PT2=Q21=Which one is NOT an Android service?
A. Local bound service
B. Intent serivce
C. Remote bound service
D. Binder service
D
PT2=Q22=A bound service must, at a minimum, implement the which method?
A. onCreate()
B. onStartCommand()
C. onBind()
D. onDestroy()
C
PT2=Q23=Which importance level of notification will make a sound when it appears?
A. High and urgent level
B. Only urgent level
C. Medium and higher level
D. Only high level
A
PT2=Q24=Which level of android API version that notification can make a direct
reply?
A. APl level 24 or higher
B. API level 20 or higher
C. APl level 27 or higher
D. APl level 7 or higher
D
PT2=Q25=The _________ class allows a request for user input to be included in the
PendingIntent object along with the intent
A. NotificationCompact
B. Remotelnput
C. NotificationManager
D. NotificationCompat.Action
B
PT2=Q26=Which class can launch an activity from a notification?
A. Pendinglntent
B. Action
C. Remotelnput
D. Intent
A
PT2=Q27=In class SQLiteOpenHelper class, there are 2 methods we should usually
override. What are they?
A. onStart() and onStop()
B. onCreate() and onUpgrade()
C. onStart() and onResume()
D. onCreate() and onDestroy()
B
PT2=Q28=Android: How do we execute Queries?
A. rawQuery()/query()
B. rawQuery()
C. query()
D. doQuery()
A
PT2=Q29=Which method perform a single SQL statement that does NOT return
result data.
A. rawQuery()
B. doQuery)
C. execSQL()
D. query()
C
PT2=Q30=Fragment life cycle in android is _____
A. onAttach()-> onResume()->onCreate() -> onCreateView() -> on ActivityCreated() -
> onStart()
B. onAttach()->onCreate() -> onCreateView() -> on ActivityCreated|() -> onStart() ->
onResume()
C. onStart() ->onAttach()->on ActivityCreated() -> onResume()
D. onStart()-> onResume() ->onAttach()->on ActivityCreated()
B
PT3=Q1=Choose the right answer to fill in blank
To develop your own service in Android, which of the following step you need to do?
Step 1. extends Service based class
Step 2. _______ {blank} _________
A. implements onBind, onUnbind, onRebind, onCreate, onDestroy methods
B. implements onStartCommand, onBind, onUnbind, onRebind methods
C. implements onStartCommand, onBind, enUnbind, onRebind, onCreate, cnDestray
methads
D. implements onCreate, onDestroy methods
C
PT3=Q2=What is a broadcast receiver in android?
A. It will do background functionalities as services
B. It will react to broadcast announcements
C None of these
D. It will pass the data between activities
B
PT3=Q3=Which type of Google map display the standard view consisting of the
classic road map?
A. GoogleMap.MAP_TYPE_SATELLITE
B. GoogleMap.MAP_TYPE_NONE
C. GoogleMap.MAP_TYPE_NORMAL
D. GoogleMap.MAP_TYPE_TERRAIN
E. GoogleMap.MAP_TYPE_HYBRID
C
PT3=Q4=You define each Room entity as a class that is annotated with @Entity.
Each instance of class represents a (1) _________ in a (2) ________ in the app's
database
A. 1 table, 2. field
B. 4.None of the others
C. 1. column, 2. table
D. 1. row, 2. table
C
PT3=Q5=How many types of Android service do we have?
A. 3
B. 1
C. 4
D. 2
C
PT3=Q6=Android: How do we execute Queries?
A. doQuery()
B. rawQuery() / query()
C. rawQuery()
D. query()
B
PT3=Q7=How to handle the Permissions Request Response when reguest a
permission at runtime?
A. isPermissionDenied()
B. onRequestPermissionsResult(}
C. shouldShowRequestPermissionRationale()
D. isPermissionGranted()
B
PT3=Q8=Which class must be implement to using SQLite database?
A. SQLiteOpenHelper
B. SQLiteDataHandler
C. SQLiteHandler
D. SQLiteDatabase
A
PT3=Q9=A socket is a software endpoint that can plug into or be plugged into to
create a bi-directional communication link between software processes
A. True
B. False
A
PT3=Q10=Do we need AP key for displaying Google Maps in Android?
A. No
B. Optional
C. Yes
C
PT3=Q11=If you have embedded the Google Maps AP| into your Android application
but it does not show the map when the application is loaded, what could be the likely
reasons?
A. All of others
B. Missing INTERNET permission in the AndroidManifest xmi file
C. Incorrect placement of the <uses-library> element in the AndroidManifest xml file
D. No Internet connection
A
PT3=Q12=Which method is called when called to do final clean up of the fragment's
state but Not guaranteed to be called by the Android platform?
A. onDestroy
B. onPause
C. onDestroyView
D. onCreateView
A
PT3=Q13=In android, which manifest permission is needed when use GPS location
A. <uses-permission android-name="android.permission
ACCESS_FINE_LOCATION"/>
B. <uses-permission android:name="android.permission
ACCESS_COARSE_LOCATION"/>
C. <uses-permission android:name="android permission
ACCESS_GIS_LOCATION"/>
D. <uses-permission android:name="android.permission
ACCESS_GPS_LOCATION"/>
A
PT3=Q14=The Room persistence library provides an abstraction layer to store the
data easily. Where does the ROOM library store data?
A. XML files
B. Room database
C. SQLite database
D. Json Text files
B
PT3=Q15=Which file contain Android permissions for and application?
A. Permission.xml
B. Manifest.xml
C ApplicationManifest.xml
D. AndroidManifest.xml
D
PT3=Q16=On android services, onStart() and onBind{) are the same?
A. True
B. False
B
PT3=Q17=Which method is NOT an override method of class ContentProvider?
A. insert()
B. delete()
C. update()
D. select()
D
PT3=Q18=The difference between SQLite and Content provider is:
A. Content provider is not a local dstabase and SQLite is a local database
B. Content provider is faster that SQLite
C. Content provider can share data with other application but SQLite cannot
D. None of the others
C
PT3=Q19=FragmentManager is the class responsible for performing actions on your
app's fragments, such as adding, removing, or replacing them, and adding them to
the back stack.
A. True
B. False
A
PT3=Q20=Which element use to define a permission in Android?
A. user-permission
B. define-permission
C. uses-permission
D. using-permission
C
PT3=Q21=Which method perform a single SQL statement that does NOT return
result data.
A. query()
B. doQueryf()
C. execSQL()
D. rawQuery()
C
PT3=Q22=What are location providers in Android?
A. 3G & Wifi
B. 3G & Network
C. GPS & Network
D. GPS & Wifi
C
PT3=Q23=What is the purpose of Data access object (DAO)?
A. provides the methods that the rest of the app uses to interact with
sharedpreferences
B. None of the others
C. provides the methods that the rest of the app uses to interact with data in
reference table provides the methods that the rest of
the app uses to interact with Ul in the activity
D. provides the methods that the rest of the app uses to interact with data in
reference table
D
PT3=Q24=To access through the result of database query, we can use class:
A. DataTable
B. Dataset
C. Iterator
D. Cursor
D
PT3=Q25=Android: Which attribute will be used in XML if the Java code needs a
reference to View?
A. android:index
B. android:id
C. android:gravity
D. android:background
B
PT3=Q26=Which method use to check permission is granted by user or not?
A. checkSelfPermission()
B. checkUserPermission()
C. checkPermission()
D. checkGrantedPermission()
A
PT3=Q27=To share data for other application, the other application must be using
______ to access data from content provider.
A. Content provider name
B. Data model
C. Path to data file
D. Content Uri
D
PT3=Q28=What is the life cycle of broadcast receivers in android?
A. onReceive()
B. implicitBroadcast()
C. sendBroadcast(), sendOrderBroadcast(), and sendStickyBroadcast()
D. send intent()
A
PT3=Q29=What is true about Fragments?
A. All of the others
B. You can combine multiple fragments in a single activity to build a multi-pane UI
C. A fragment has its own layout and its own behaviour with its own life cycle
callbacks
D. You can add or remove fragments in an activity while the activity is running
A
PT3=Q30=In class SQLiteOpenHelper class, there are 2 methods we should usually
override. What are they?
A. onStart() and onResume()
B. onStart() and onStop()
C. onCreate() and onDestroy()
D. onCreate() and onUpgrade()