50+ Android - Solved MCQ's [Topic Wise Sorted]
Android - Objective questions and answers
Introduction:
Q.1 What is the use of versionCode attribute in AndroidManifest.xml file?
A) It is used to define the current application version.
B) It is used to define the current application name.
C) It is used to define the public version that will be displayed to users.
D) None of the above.
ANSWER: A
Read This: How Android OS works in Smartphones?
Q.2 Android is open source true or false?
A) True
B) False
ANSWER: A
Q.3 What is used by android for relational data storage?
A) Tomcat
B) SQL
C) SQLiteDatabase
D) None of the above.
ANSWER: C
Learn : Android VS iOS Architecture
Q.4 What is true about an Android Virtual Device (AVD)?
A) An AVD is an emulator instance that enables you to model an actual device.
B) You can create more than one AVDs in order to test your applications with several different configurations.
C) You cannot create more than one AVDs.
D) Option A and B are correct.
ANSWER: D
Q.5 In which file, permissions are set in Android?
A) Src
B) AndroidManifest.xml
C) Bin
D) None of the above.
ANSWER: B
Q.6 In which file, all string constant should be stored in android?
A) AndroidManifest.xml
B) Bin
C) strings.xml
D) None of the above.
ANSWER: C
Q.7 Which virtual machine is used by Android to run application?
A) JVM
B) Dalvik VM
C) AVD
D) None of the above.
ANSWER: B
Learn : Android VS iOS Architecture
Q.8 What is the full form of DDMS?
A) Dalvik Debug Monitoring Service
B) Dalvik Design Monitoring Service
C) Direct Debug Monitoring Service
D) None of the above.
ANSWER: A
Q.9 Choose the correct option regarding activity in android.
A) Activity is a class.
B) When you create an android application your activity (class) is, by default inherited from Activity class.
C) Option A and B are correct.
D) None of the above.
ANSWER: C
Q.10 In Android, visual components are called.
A) Views
B) Components
C) DLL
D) None of the above.
ANSWER: A
Learn : How iOS Works in iPhone?
Q.11 Which tool is used to monitor and control the Emulators on which you are debugging your applications.
A) Android Asset Packaging Tool (AAPT)
B) Dx
C) DDMS
D) None of the above.
ANSWER: C
Q.12 Choose the correct option regarding activity in android.
A) An activity is a window that contains the user interface of your application.
B) An application can have zero or more activities.
C) An application can have only one activity.
D) Option A and B are correct.
ANSWER: D
Intents:
Q.13 Suppose that there are two activities in an application named ActivityOne and ActivityTwo. You want to invoke ActivityTwo from ActivityOne. What code you will write?
A) Intent intent=new Intent (this, ActivityTwo.class);
startActivity(intent);
B) startActivity(new Intent(this, ActivityTwo.class));
C) Option A and B are correct.
D) None of the above.
ANSWER: C
Q.14 What is the permission for using the camera?
A. android.permission.USE_CAMERA
B. android.permission.CAMERA
C. android.permission.hardware.CAMERA
D) None of the above.
ANSWER: B
Q.15 The Log class supports which log types?
A) Error
B) Warning
C) Debug
D) All of the above.
ANSWER: D
Q.16 If you need to pass data back from an activity, Which method you should use?
A) startActivity()
B) startActivityForResult()
C) ActivityForResult()
D) None of the above.
ANSWER: B
Q.17 If you want to navigate from one activity to another then android provides you which class?
A) Object
B) startActivity
C) Intent
D) None of the above.
ANSWER: C
Q.18 The types of intents in android is\are
A) Explicit intents
B) Implicit intents
C) Start intents
D) Option A and B are correct.
ANSWER: D
Q.19 In android mini-activities are also known as.
A) Adapter
B) Activity
C) Fragments
D) None of the above.
ANSWER: C
Q.20 How will you reference a textbox control in java file, that is available in XML file and the ID is txtName.
A) EditText txtEmpName;
txtEmpName=findViewById(R.id.txtName);
B) EditText txtEmpName;
txtEmpName=(EditText)findViewById(R.id.txtName);
C) EditText txtEmpName;
txtEmpName=(EditText)findViewById(txtName);
D) None of the above.
ANSWER: B
Q.21 Suppose that there are two activities in an application named FirstActivity and SecondActivity. You want to send website name from ActivityOne to ActivityTwo. What code you will write? Suppose that website name is “CareerRide.com”
A) Intent intent=new Intent (this, SecondActivity.class);
intent.putExtra("name", “CareerRide.com”);
startActivity(intent);
B) Intent intent=new Intent (this, SecondActivity.class);
intent.putExtra( “CareerRide.com”);
startActivity(intent);
C) Intent intent=new Intent ();
intent.putExtra("name", “CareerRide.com”);
startActivity(intent);
D) None of the above.
ANSWER: A
Q.23 How will you get the data in secondActivity? Refer question 10.
A) Intent intent=new Intent;
String str= intent.getStringExtra("name");
Toast.makeText(this, str , Toast.LENGTH_LONG).show();
B) Intent intent=getIntent();
String str= intent.getStringExtra("name");
Toast.makeText(this, str , Toast.LENGTH_LONG).show();
C) Intent intent=getIntent();
String str= intent.getText("name");
Toast.makeText(this, str , Toast.LENGTH_LONG).show();
D) None of the above.
ANSWER: B
Q.24 For creating Fragments the java class needs to extend which base class?
A) MainActivity
B) MiniActivity
C) Fragment
D) None of the above.
ANSWER: C
Storage mechanisms:
Q.25 What is/are storage option available in android?
A) SharedPreferences
B) SQLiteDatabase
C) ContentProvider
D) All of the above.
ANSWER: D
Q.26 Which objects stores the data only in key-value pair?
A) SharedPreferences
B) SQLiteDatabase
C) ContentProvider
D) None of the above.
ANSWER: A
Q.27 SharedPreferences stores the data in which format?
A) TXT
B) XML
C) DOC
D) None of the above.
ANSWER: B
Q.28 Which objects stores only primitive data type?
A) SharedPreferences
B) SQLiteDatabase
C) ContentProvider
D) None of the above.
ANSWER: A
Q.29 You want to store website name by using SharedPreferences. Choose the correct option for doing this.
A) SharedPreferences obj=getSharedPreferences("MySharedFile", Context.MODE_PRIVATE);
obj.putString(“name”, “CareerRide.com”);
obj.commit();
B) SharedPreferences obj= new SharedPreferences ("MySharedFile",
Context.MODE_PRIVATE);
String n=obj.getString("name", null);
C) SharedPreferences obj=getSharedPreferences("MySharedFile", Context.MODE_PRIVATE);
Editor editor=obj.edit();
editor.putString(“name”, “CareerRide.com”);
editor.commit();
D) None of the above.
ANSWER: C
Q.30 You want to read website name by using SharedPreferences. Choose the correct option for doing this.
A) SharedPreferences obj=getSharedPreferences("MySharedFile ", Context.MODE_PRIVATE);
String n=obj.getString("name", null);
B) SharedPreferences obj= new SharedPreferences ("MySharedFile", Context.MODE_PRIVATE);
String n=obj.getString("name", null);
C) String n=obj.getString("name", null);
D) None of the above.
ANSWER: A
Q.7 To write files on the external storage, which permission you will write in AndroidManifest.xml file
A) WRITE_STORAGE
B) WRITE_EXTERNAL_DATA
C) WRITE_EXTERNAL_STORAGE
D) None of the above.
ANSWER: C
Q.31 In order to use internal storage to write some data in the file, which method will be used?This method returns FileOutputStream.
A) openFileInput()
B) openFileOutput()
C) openForWrite()
D) None of the above.
ANSWER: B
Q.9 To check whether the media(external storage) is available, which method of Environment class you will use?
A) getExternalStorageState()
B) getExternalStorage()
C) getExternalStateData()
D) None of the above.
ANSWER: A
Q.32 If you want share the data from one application to other applications,ou will which object you will use?
A) SQLiteDatabases
B) InternalStorage
C) SharedPreferences
D) ContentProvider
ANSWER: D
Q.33 Which of the following statements is correct?
A) Permissions are not specified in AndroidManifest.xml.
B) The AndroidManifest.xml is optional.
C) The AndroidManifest.xml must supply a unique Application package name for your App.
D) None of the above.
ANSWER: C
Q.34 What is the full form of AVD in Android?
A) Android Virtual Device
B) Android Virtual Display
C) Actual Virtual Display
D) All of the above.
ANSWER: A
Q.36 Android provides the following functionality.
A) Security
B) Networking
C) Portability
D) All of the above.
ANSWER: D
Q.36 What runs in the background and does not have any user interface?
A) PendingIntent
B) Service
C) Intent
D) None of the anove.
ANSWER: B
Q.37 Which one is not a nickname of android OS?
A) Honeycomb
B) CupCake
C) Muffin
D) None of the above.
ANSWER: C
Content Provider:
in Android - questions and answers
Q.38 To share data across packages in Android which object you will prefer?
A) SharedPreference
B) ContentProvider
C) DataProvider
D) None of the above.
ANSWER: B
Q.39 To query a content provider, you specify the query string in the form of a URI. The format of the query URI is as follows:
<standard_prefix>://<authority>/<data_path>/<id>
What you will write in place of <standard_prefix> ?
A) content
B) object
C) ContentProvider
D) None of the above.
ANSWER: A
Q.40 For reading the contacts from the Contacts, Which permission you will set in AndroidManifest.xml file if you are using ContentProvider.
A) FIND_CONTACTS
B) GET_CONTACTS
C) READ_CONTACTS
D) None of the above.
ANSWER: C
Q.41 SimpleCursorAdapter object maps a cursor to which view, defined in your XML file?
A) TextViews
B) ImageViews
C) Both A and B option are correct.
D) None of the above.
ANSWER: C
Q.42 What are the predefined query string constants available in Android?
A) ContactsContract.Contacts.CONTENT_URI
B) Browser.SEARCHES_URI
C) MediaStore.Images.Media.INTERNAL_CONTENT_URI
D) All of the above.
ANSWER: D
Q.43 Choose the correct option according to the given option.
Statement 1: A content provider behaves very much like a database — you can query it,
edit its content, as well as add or delete content.
Statement 2: Content providers let you centralize content in one place and have many
different applications access it as needed.
Statement 3: A content provider does not provide the facility to centralize content.
A) Only option 1 is correct.
B) Only option 2 is correct.
C) Option 1 and 2 are correct.
D) Option 1 and 3 are correct.
ANSWER: C
Q.44 For Creating your own content provider which class you will inherit?
A) Content
B) ContentProvider
C) Object.
D) None of the above.
ANSWER: B
Q.45 What is Android Interface Definition Language (AIDL)?
A) AIDL does not the Java programming language.
B) It does not define the programming interface.
C) It defines the programming interface that both the client and service agree upon in order to communicate with each other using inter process communication (IPC).
D) None of the above.
ANSWER: C
Q.38 To share data across packages in Android which object you will prefer?
A) SharedPreference
B) ContentProvider
C) DataProvider
D) None of the above.
ANSWER: B
Q.39 To query a content provider, you specify the query string in the form of a URI. The format of the query URI is as follows:
<standard_prefix>://<authority>/<data_path>/<id>
What you will write in place of <standard_prefix> ?
A) content
B) object
C) ContentProvider
D) None of the above.
ANSWER: A
Q.40 For reading the contacts from the Contacts, Which permission you will set in AndroidManifest.xml file if you are using ContentProvider.
A) FIND_CONTACTS
B) GET_CONTACTS
C) READ_CONTACTS
D) None of the above.
ANSWER: C
Q.41 SimpleCursorAdapter object maps a cursor to which view, defined in your XML file?
A) TextViews
B) ImageViews
C) Both A and B option are correct.
D) None of the above.
ANSWER: C
Q.42 What are the predefined query string constants available in Android?
A) ContactsContract.Contacts.CONTENT_URI
B) Browser.SEARCHES_URI
C) MediaStore.Images.Media.INTERNAL_CONTENT_URI
D) All of the above.
ANSWER: D
Q.43 Choose the correct option according to the given option.
Statement 1: A content provider behaves very much like a database — you can query it,
edit its content, as well as add or delete content.
Statement 2: Content providers let you centralize content in one place and have many
different applications access it as needed.
Statement 3: A content provider does not provide the facility to centralize content.
A) Only option 1 is correct.
B) Only option 2 is correct.
C) Option 1 and 2 are correct.
D) Option 1 and 3 are correct.
ANSWER: C
Q.44 For Creating your own content provider which class you will inherit?
A) Content
B) ContentProvider
C) Object.
D) None of the above.
ANSWER: B
Q.45 What is Android Interface Definition Language (AIDL)?
A) AIDL does not the Java programming language.
B) It does not define the programming interface.
C) It defines the programming interface that both the client and service agree upon in order to communicate with each other using inter process communication (IPC).
D) None of the above.
ANSWER: C
Android Telephony and SMS:
Q.46 Which permission you need to declare in your AndroidManifest.xml file for sending SMS.
A) <uses-permission android:name="android.permission.SEND_SMS"/>
B) <uses-permission android:name="android.SEND_SMS"/>
C) <uses-permission ="android.permission.SEND_SMS"/>
D) None of the above.
ANSWER: A
Q.47 Which class is used to send SMS programmatically?
A) SmsSender
B) SmsManager
C) SMS
D) None of the above.
ANSWER: B
Q.48 What code you will write to send the SMS to another AVD? Suppose that the AVD no is 5556
A) SmsManager sms=new SmsManager();
sms.sendTextMessage("5556", null, "Hello Android", null, null);
B) SmsManager sms=new SmsManager();
sendSMS("5556", null, "Hello Android", null, null);
C) SmsManager sms=SmsManager.getDefault();
sms.sendTextMessage("5556", null, "Hello Android", null, null);
D) None of the above.
ANSWER: C
Q.49 How to get feedback on message sent?
A) Use two Intent objects in the sendTextMessage() method.
B) Use two PendingIntent objects in the sendTextMessage() method.
C) Use two PendingIntent objects in the startActivity() method.
D) None of the above.
ANSWER: B
Q.50 What is the purpose of the ImageSwitcher?
A) The ImageSwitcher enables images to be displayed with animation.
B) The ImageSwitcher displayed images without animation.
C) An image switcher allows you to add some transitions on the images.
D) Option A and C are correct.
ANSWER: D
Q.51 What types of menus is/are supported by Android?
A) Option menu and Context menu
B) Only Option menu
C) Only Context menu
D) None of the above.
ANSWER: A
Q.52 Which is Parent class of Activity?
A) ActivityGroup
B) Context
C) BaseActivity
D) ContextThemeWrapper
ANSWER: D
Q.53 Which is/are related to fragment class?
A) dialogFragment
B) listFragment
C) preferenceFragment
D) All of the above.
ANSWER: D
Q.54 Which permission you need to declare in your AndroidManifest.xml file for initiating a call using the system in-call Activity?
A) CALL_NUMBER uses-permission
B) DIAL_PHONE uses-permission
C) CALL_PHONE uses-permission
D) None of the above.
ANSWER: C
Q.55 To initate a call using the Intent which code you will write?
A) Intent intent = new Intent (Intent.ACTION_CALL)”);
startActivity(intent);
B) Intent intent = new Intent (Intent.ACTION_CALL, Uri.parse(“tel:9923----”));
startActivity(intent);
C) Intent intent = new Intent (Uri.parse(“tel:9923----”));
startActivity(intent);
D) All of the above.
ANSWER: B
Q.56 For accessing the subscriber identity module (SIM) detail which class you will use?
A) SimManager
B) TelephonyManager
C) MobileManager
D) All of the above.
ANSWER: B
Q.57 For sending sms through Intent which code is correct?
A) Intent intent = new Intent();
intent.putExtra("sms_body", "Welcome at CareerRide.com");
startActivity(intent);
B) Intent intent = new Intent();
startActivity(intent);
C) Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:9923-----"));
intent.putExtra("sms_body", "Welcome at CareerRide.com");
startActivity(intent);
D) None of the above.
ANSWER: C
Mobile Application Development Solutions Lucknow India,
ReplyDeleteiPhone Apps Development in Lucknow India,
iOS App Development Company in Lucknow India,
Application Development and Maintenance Service Lucknow India,
Mobile Application Maintenance & Support Services in Lucknow India,
Software Maintenance And Support Services in Lucknow India,
Software Development Outsourcing Company in Lucknow India,
Thanks for sharing ! Nice post with good information to the readers and here is the best Android App Development Company in Hyderabad for develop the app to enhance your business.
ReplyDeleteI found your blog on google and I just added you to my Google News Reader. Keep up the great work
ReplyDeleteDigital Marketing Courses in Bangalore
Best Digital Marketing Courses in Bangalore
Best Digital Marketing Institute in Bangalore
Hadoop Training in Bangalore
Seo Course in Bangalore
German Classes in Bangalore
Selenium Training in Bangalore
Big Data Training in Bangalore
German Language Course in Bangalore
Selenium Course in Bangalore