Mobile Application Development MCQs: Android Development

Mobile Application Development MCQs. Multiple-Choice Questions regarding Mobile Application Development with Android. For Detailed Android Multiple Questions see Android MCQ.

 

Mobile Application Development MCQs

 

 

Which of the following is incorrect about the LogCat tool?

a. A LogCat view is available as part of the ADT plugin of Eclipse
b. You can create a log in your application using Log.v(String, String)
c. Each log message has a tag
d. Only one of your application can create log entries, and it should be a component class (Activity, Service,…etc)

 

Which of the following methods is called an Activity when another activity gets into the foreground ??

a. onStop( )
b. onPause( )
c. onDestroy( )
d. onExit( )

Which of the following information is not included in the Manifest file ??

a. The activities contained in the application
b. The permissions required by the application
c. The application’s minimum SDK version required.
d. The handset model compatible with your application

 

Which of the following attributes is used to set an activity screen to landscape orientation ??

a. screenorientation = landscape
b. screenOrientation=”landscape”
c. android:ScreenOrientation=“landscape”
d. android:screenOrientation=”landscape”

Which method should you use to start a sub-activity?

a. startActivity(Intent intent)
b. startActivityForResult(Intent intent)
c. startService(Intent intent)
d. startSubActivity(Intent intent)

 

Mobile Application Development MCQs

 

What is not true about the AndroidManifest.xml file ??

a. It declares the views used within the application
b. It declares user permissions the application requires
c. It declares application components
d. It declares hardware and software features used within the application

Which package of the following does not have classes needed for Android network connections?

a. java.net
b. org.apache.http
c. android.location
d. android.net

 

If your application is throwing exception android.content.ActivityNotFoundException, how to fix it ??

a. Create a new activity Java sub-class.
b. Rename your activity
c. Create the activity layout
d. Add the activity to the AndroidManifest

Which of the following tools creates certificates for signing Android applications ??

a. adb
b. logcat
c. keytool
d. certgen

 

Consider the following code

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse(“http://www.myandroid.site”));
startActivity(intent);

Which of the following is correct about the code above ??

a. It sends a result to a new Activity in a Bundle
b. It will not compile without adding the INTERNET permission to the Manifest file
c. It starts any activity in the application that has a WebView in its layout
d. When it is executed, the system starts an intent resolution process to start the right

 

Android Development Development

 

Which manifest file permission you should add to allow your application to read the device’s address book ??

a. READ_ADDRESS_DATA
b. READ_PHONE_STATE
c. READ_PHONE_CONTACTS
d. READ_CONTACTS

 

Which of the following is not true about the <activity> tag in the AndroidManifest file ??

a. Declares an activity that implements part of the application’s visual user interface
b. Contained in <application> tag
c. Declares a single hardware or software feature that is used by the application
d. Has an attribute that specifies the name of the Activity subclass that implements the activity.

You can create a custom view by extending the class ??

a. android.widget.View
b. android.widget.LinearLayout
c. android.view.View
d. android.content.Context

 

Which of the following Android View sub-classes uses the WebKit rendering engine to display web pages ??

a. PageView
b. WebView
c. MapView
d. HttpClient

In which Activity life-cycle method you should do all of your normal static set up such as: creating views and bind data to lists ??

a. onResume()
b. onStart()
c. onCreate()
d. onPause

 

Mobile Application Development MCQs

 

Which of the following lines of codes adds zoom controls to a WebView ??

a. webView.getSettings().setBuiltInZoomControls(true);
b. webView.getSettings().setZoomControls(true);
c. webView.getZoomSettings().setControls(CONTROLS.enabled);
d. Zoom controls are included by default in WebViews.

Which of the following lines of code starts activity Activity2 from a current activity Activity1 ??

a. Intent intent = new Intent(this,new Activity2());
startActivity(intent);

b. Intent intent = new Intent(new Activity2());
startActivity(intent);

c. Intent intent = new Intent (Activity1.class,Activity2.class);
startActivity(intent);

d. Intent intent = new Intent(this,Activity2.class);
startActivity(intent);

 

Which of the following best explains the Android option menus ??

a. It is a popup menu that displays a list of items in a vertical list anchored to the view that invoked the menu
b. It 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 context frame
c. It is the primary collection of menu items for an activity where you should place actions that have a global impact on the app, such as “Search,” “Compose an email,” and “Settings.”
d. It is a type of List Activity with predefined headers and footers for special commands

 

Which two of the following apply to the onDraw() method of class View ??

a. It must be overridden if a customize drawing of a view is required
b. It takes two parameters: a Canvas and a View
c. It takes one parameter of type Canvas
d. It uses the Canvas parameter to draw the border of the activity that contains it

 

Which of the following best explains the Android context menus ??

a. It is a popup menu that displays a list of items in a vertical list that’s anchored to the view that invoked the menu
b. It 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 context frame
c. It is the primary collection of menu items for an activity. It’s where you should place
actions that have a global impact on the app, such as “Search,” “Compose an email,” and “Settings.”
d. It is a sub-menu of an options menu item

 

Mobile Application Development MCQs

 

Which of the following you cannot achieve by creating your own View sub-classes ??

a. Create a completely new customized View type
b. Combine a group of View components into a new single-component
c. Specify when to destroy an activity and all its views
d. Override the way that an existing component is displayed on the screen

 

Consider the following code 

@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle(“Menu”);
AdapterContextMenuInfo cmi = (AdapterContextMenuInfo) menuInfo;
menu.add(1, cmi.position, 0, “Open file”);
menu.add(2, cmi.position, 0, “Save file”);
}

Which of the following best explains the code above ???

 

a. The code inflates an XML file into menu items
b. The code creates menu items for context menu programmatically
c. The code assign actions to menu items
d. The code Opens a menu resource file, modifies it, and saves the changes

 

Which of the following is required to allow the Android Developer Tools to interact with your view ??

a. Provide a constructor that takes a Context and an AttributeSet object as parameters
b. Provide a constructor that takes a Context object as a parameter
c. Extend class View
d. Override method onDraw() of class View

 

What are the main two types of thread in Android ??

a. Main thread and worker threads
b. Main thread and the UI thread
c. Activities and services
d. Main thread and background process

 

Which of the following AsyncTask methods is NOT executed on the UI thread ??

a. onPreExecute()
b. onPostExecute()
c. publishProgress()
d. onProgressUpdate()

 

Which of the following is NOT true about method getWindow() of class Dialog do ??

a. It retrieves the current window for activity
b. It can be used to access parts of the Windows API
c. It displays the dialog on the screen
d. It returns null if the activity is not visual

 

Which two of the following are true about the Dialog class ??

a. You can add a custom layout to a dialog using setContentView()
b. A dialog has a life-cycle independent of Activity
c. A dialog is displayed on the screen using method show()
d. It does not have a method to access the activity that owns it

 

Which of the following is a NOT valid form of notification invoked by the NotificationManager ??

a. A Flashing LED.
b. A persistent icon in the status bar
c. A sound played
d. An SMS sent

 

Which of the following a Notification object must contain ??

a. A small icon
b. A detailed text
c. A title    
d. All of the above

 

More MCQ Posts

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!