R4RIN
Articles
Java 8
MCQS
Android MCQ Quiz Hub
Android Programming MCQ Set 1
Choose a topic to test your knowledge and improve your Android skills
1. The _____ is a possible media type value for the media attribute.
Viewport
Embossed
Page box
Aspect-ratio
2. Which subclass of a Preference class displays a list of entries as a dialog?
ListPreference
MultiSelectListPreference
None of these
Both of these
3. What is an application component that can perform long-running operations in the background and does not provide a user interface?
Broadcast receiver
Content-provider
Activity
Service
4. What is the first method called in the Activity Lifecycle?
onBegin()
onResume()
onInit()
onCreate()
5. Which Virtual Machine (VM) does the android system use?
Erlang
VMLite
Dalvik
KVM
6. What is the brand name of Google's own line of Android smartphones?
Galaxy
Nexus
Optimus
Desire
7. Which of the following are a function of the manifest file?
declare the level of user permissions required.
declare the minimum API level required
all of these
None of These
8. Your Android application components are defined in the...
myApp.xml file.
AndroidManifest.xml file.
AndroidManifest.pkg file.
None of the above
9. In order to specify layouts so that they adapt to any screen size, specify dimensions in:
Density-independent pixels
Pixels
both (a) and (b)
None of the above
10. Which of the following are versions of Android?
Eclair
Gingerbread
Froyo
All of these
11. Which statement correctly changes content of a TextView named textLabel to show "Your Text"?
textLabel.setText("Your Text");
textLabel = "Your Text";
textLabel.text = "Your Text";
textLabel.text("Your Text");
12. The Android Manifest file has what extension?
.jar
.apk
java
xml
13. Which of the following are different types of Android application components?
all of these
services
activities
none of these
14. Which of the following is used to detect when a user clicks or taps on a button?
OnTapListener
OnTouchListener
OnClickDetecter
OnClickListener
15. Which of these widgets is an input box for a user to enter text?
Label
TextBox
EditText
TextView
16. Who can submit applications to the Marketplace?
Anyone and everyone
Registered Android Market developers
Only Google employees
Only device manufacturers and their employees
17. What is the recommended IDE for Android by Google
Android Studio
IntelliJ IDEA
Netbeans
Eclipse ADT
18. If you wanted to store a name/value string pair for your Android application, which class would you use?
android.content.Resources
android.content.SharedPreferences
android.content.Cookies
None of the above
19. Which is NOT a default value used for a Toast length parameter?
LENGTH_SMALL
LENGTH_LONG
LENGTH_SHORT
None of these
20. The Android SDK tools compile your application into an Android application (.apk file) which...
contains all the information needed to install the application on an Android device.
then has to be formatted for installation through the Android installer.
contains information needed by the Universal Mobile Installer to create the install package for Android devices.
None of These
21. In activity A if you start Activity B with result you should override
onActivityResult(int requestCode, int resultCode, Intent data) on Activity A
onResultedActivity(int requestCode, int resultCode, Intent data) on Activity B
onResultedActivity(int requestCode, int resultCode, Intent data) on Activity A
none of the above
22. What is the main hardware platform of Android?
MIPS
x86
ARM architecture
None of these
23. If your application uses the camera on an Android powered device, the following line should be in your manifest file
<uses-feature android:name="android.hardware.camera" />
<uses-feature="android.hardware.camera" />
<uses-feature name="camera" />
None of these
24. What is the proper order of life cycle methods called when an Activity is first run?
onStart(), onResume, onCreate()
onCreate(), onRestart(), onResume()
onCreate(), onResume(), onStart()
onCreate(), onStart(), onResume()
25. In which resource folder do we create an animation file ?
drawable
raw
anim
animation
26. In order to be notified of a device switching from landscape to portrait view, you should:
Override the onConfigurationChanged event
Request changes via the android:configChanges="orientation" attribute for activities in your manifest file
Both of these
None of these
27. How do you disable the scrollbars for a webview?
<WebView android:layout_height="wrap_content" />
<WebView android:layout_height="wrap_content" />
<WebView android:layout_width="wrap_content" />
all of these
28. What permission does your application need to use the network?
android.permission.INTERNET
android.permission.NETWORK
android.security.NETWORK
android.security.NETWORK
29. What is the name of the main thread in Android
Working Thread
Main Thread
UI thread
None of the above
30. Which tag is used to add "Star Rating" in XML layout file?
RatingWidget
Stars
RatingBar
Rating
31. Which layout is deprecated since version 2.3?
Frame Layout
Absolute Layout
Table Layout
Relative Layout
32. Every Android application runs in its own process...
within a shared system wide instance of the Dalvik Virtual Machine.
with its own instance of the Dalvik Virtual Machine.
with its own instance of the Java Virtual Machine.
None of these
33. What is the name of the new design guidelines given by Google ?
Holo
Classic
Flat Design
Material Design
34. What are some examples of direct descendants of the android.view object?
ProgressBar
ViewGroup
Neither of these
Both of these
35. What AIDL is?
Android InterProcess Definition Language
Android Interface Definition Language
Android InterProcess Dynamic Language
Android Interface Dynamic Language
36. Who is known as the 'Father' of Android?
Hugo Barra
Sandar Pichai
Sergey Brin
Andy Rubin
37. Which of these is NOT a Layout derived from the ViewGroup class?
RelativeLayout
AbsoluteLayout
LinearLayout
ListViewLayout
38. How do you get an intent data inside a fragment basically?
Bundle args = getExtras().getActivity();
Bundle args = new Bundle(getActivity().getIntent().getExtras());
Bundle args = getActivity().getIntent().getExtras();
Bundle args = getIntent().getActivity.getExtras();
39. How can you assign a custom (NOT BUILT IN ANDROID) font typeface to a TextView?
In code: mTextViem.setTypeface(Typeface myfont);
In styles xml: <item name="android:typeface|>"myfont"</item>
In layout xml: android:typeface="myfont"
None of the above
40. Which of these ListAdapter subclasses is not a direct subclass of BaseAdapter?
SimpleAdapter
CursorAdapter
ArrayAdapter
HeaderViewListAdapter
41. Android applications can "borrow" functionality from other applications by using...
intent objects
content Provider system
application lifecyle methods
None of the above
42. If the UI begins to behave sluggishly or crash while making network calls this is likely due to ....
Hardware malfunction
Activity Manager contains too much
Virus on the server
Network Latency
43. Which of the following allows you to instantinate a LocationManager class?
LocationManager lm = (LocationManager)Runtime.getSystemServiceInstance(Context.LOCATION_SERVICE);
LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationManager lm = new LocationManager(Context.LOCATION_SERVICE);
LocationManager lm = (LocationManager)SystemServiceFactory.createSystemService(Context.LOCATION_SERVICE);
44. Is it possible to reverse engineer an android application using the apk file alone without external app resources?
No
Yes,at any point in time
Yes but not always
None of the above
45. In order to get paired Bluetooth device list you need to :
not possible
add <user-feature android:name="android.permission.BLUETOOTH" /> feature to the manifest.xml
none of the above
add <user-permission android:name="android.permission.BLUETOOTH_ADMIN" /> permission to the manifest.xml
46. What should you extend in case you need to apply a portion of code to your entire application?
Application(import both android.app.Activity and anroid.app.Application)
Activity(import android.app.Activity)
ApplicationInfo(import android.app.*)
Class(import android.app.Activity and android.app.Application)
47. if you want to access list of paired Bluetooth devices on Android, what should you do ?
add to the manifest.xml
add to the manifest.xml
both (a) and (b)
None of the above
48. Which of the following is NOT a subclass of TextView?
Button
Radio Button
EditText
Image Button
49. How to enable overlay mode On API level 11 or higher, to create a custom theme for your activity.
<item name="ActionBar:Overlay">true</item>
<item name="ActionBarOverlay">true</item>
<item name="android:ActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
50. Which of the following is a public constructor for canvas?
canvas(int color)
canvas(Context context)
canvas(Bitmap bitmap
canvas(AttributeSet set)
51. How do you enable hardware acceleration in android?
permission:hardwareAccelerated="true"
android:hardwareAccelerated="true"
android:permission:hardwareAccelerated="true"
use:permission:hardwareAccelerated="true"
52. Which service is used to perform IPC, when bind application to a service?
bindService()
activity.bindService()
application.bindService()
service.application.bindService()
53. What permission is required for your application to use the device's vibrate hardware?
android.hardware.permission.VIBRATE
android.permission.hardware.VIBRATE
android.hardware.VIBRATE
android.permission.VIBRATE
54. You can control process usage in your Android application by...
moving your components up in the process lifecycle hierarchy.
both of these
using the android:process attribute on the specific component defined in the manifest.
None of the above
55. How do you display the Action Bar back button on all Android versions?
getSupportActionBar().setDisplayBackButton(true);
getActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
None of the above
56. AppWidgetProvider is a subclass of
Intent
Service
Activity
BroadcastReceiver
57. Which class MediaPlayer extends in android?
MediaPlayerToolKit
AndroidMediaPlayer
Object
Activity
58. Which of the following is an Android class for the playback of sound?
MediaPool
Music
SoundPlayer
SoundPool
59. how can you check if your activity is first on stack ?
activity.isTaskRoot()
(ActivityManager) getSystemService(Context.ACTIVITY_SERVICE).isTaskRoot() both
Both A & B
None of These
60. What is the correct argument passed in the Array.sort() function
CASE_INSENSITIVE
INSENSITIVE_CASE_ORDER
CASE_ORDER
CASE_INSENSITIVE_ORDER
61. Which method can be called to destroy an activity?
finish()
finishActivity()
onDestroy()
close()
62. Which of these run in a separate thread?
IntentService
None of them
Both of them
Service
63. What does this layout show?
a textview aligned to the right in the layout and the text is centered
a textview center in the layout and the text aligned to the right in his own container
a textview aligned to the right in the layout
a textview center in the layout
64. What is an Intent ?
a function
a message
a process
an action
65. What will be the result of this intent? Intent intent = new Intent(A.this, B.class); startActivityForResult(intent , -1);
do nothing
call startActivity() from Activity A
call onActivityResult() from Activity A✖
call onActivityResult() from Activity B
66. Where is navigation drawer support available?
Android Support Library v14
Android Support Library v21
Android Support Library v4✖
Android Support Library v7
67. According to the Activity's lifecycle, how is named the first method callback of an Activity?
protected void onCreate();
protected void onCreate(Parcelable parcelable);
protected void onCreate(Intent intent);
protected void onCreate(Bundle savedInstanceState);
68. Which component does not exist in the android sdk ?
CheckBoxButton
EditText
TextView
ImageView
Submit