Android quiz questions

Android interview questions

  • 1.

    Which of these is the incorrect method for an Application to save local data?

    1. Save in the hash table file using the Dictionary class.

    2. Save in the database using SQLite.

    3. Extend PreferencesActivity and save in an XML file.

    4. Save as a file in the local file system.

    Answer
  • 2.

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

    1. keytool

    2. certgen

    3. logcat

    4. adb

    Answer
  • 3.

    Which of the following classes should be extended to create a custom view?

    1. ViewGroup

    2. Context

    3. Activity

    4. View

    Answer
  • 4.

    Which of the following is NOT a valid usage for Intents?

    1. Activate a Service

    2. Activate a Broadcast receiver

    3. Activate an Activity

    4. Activate a SQLite DB Connection

    Answer
  • 5.

    What two methods you have to override when implementing Android context menus?

    1. onCreateOptionsMenu, onContextItemSelected

    2. onCreateOptionsMenu, onOptionsltemSelected

    3. onCreateOptionsMenu, onCreateContextMenu

    4. onCreateContextMenu, onContextItemSelected

    Answer
  • 6.

    Which of the following is true about this code snippet? (Choose two)

    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel: 555-1234"));
    startActivity(intent);

     

    1. The system will perform an intent resolution to start the proper activity.

    2. The system will not dial the number without adding permission CALL_PHONE.

    3. The code will not compile.

    4. This is an explicit intent that start the system's dialer.

    Answer
  • 7.

    Which of the following is not true about using a WebView in your application?

    1. You can retrieve WebSettings with getSettings(), then enable/disable JavaScript

    2. You use loadData to load HTML

    3. You use loadURL to load a webpage

    4. You need to add permission "android.permission.ACCESS_NETWORK_STATE"

    Answer
  • 8.

    You can create a custom view by extending class:

    1. android.widget.View

    2. android.content.Context

    3. android.widget.LinearLayout

    4. android.view.View

    Answer
  • 9.

    What is the name of the folder that contains the R.java file?

    1. bin

    2. res

    3. gen

    4. src

    Answer
  • 10.

    Which method is used to close an activity?

    1. stop()

    2. finish()

    3. destroy()

    4. close()

    Answer
  • 11.

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

    1. screenOrientation="landscape"

    2. android:ScreenOrientation="landscape"

    3. screenorientation = landscape

    4. android:ScreenOrientation="landscape"

    Answer
  • 12.

    Which of the following is true about implicit intents? (Choose two)

    1. They must contain extra information saved in a Bundle object.

    2. They have components specified to run an exact class.

    3. They do not have a component specified

    4. They must include information that allows Android system to choose the best component to run.

    Answer
  • 13.

    Consider the following the code:

    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.game_menu, menu);
        return true;
    }

    Which of the following is true about the code above?

    1. This method handles clicks and assign actions to menu items.

    2. This function inflates an XML file in the res/menu folder into menu items.

    3. The code is auto generated and should not be edited.

    4. This method inflates an XML file in the res/layout folder into layout.

    Answer
  • 14.

    What is the parent class of all Activity widgets?

    1. Layout

    2. View

    3. Widget

    4. ViewGroup

    Answer
  • 15.

    Which of the following is NOT true about the Menultem interface?

    1. Menultem can set a checkbox.

    2. Menultem can decide the Intent issued when clicking menu components.

    3. The Menultem instance will be returned by the Menu class add(...) method.

    4. Menultem can display either an icon or text.

    Answer
  • 16.

    Which of the following is not a ContentProvider provided natively by Android?

    1. The telephone log

    2. The Contacts list

    3. The bookmarks

    4. The application list

    Answer
  • 17.

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

    1. Declares a single hardware or software feature that is used by the application.

    2. Contained in <application> tag.

    3. Declares an activity that implements part of the application's visual user interface

    4. Has an attribute that specifies the name of the Activity sub-class that implements the activity.

    Answer
  • 18.

    Which of the following is NOT true about class Asynctask?

    1. It must be created on the UI thread.

    2. It uses three generic types.

    3. It must be used by sub-classing it.

    4. Its sub-class override at least two methods: doInbackground, onPostExecute.

    Answer
  • 19.

    Method onDraw() of class android.view.View has the following signature:

    1. public boolean onDraw(Canvas)

    2. public Canvas onDraw()

    3. public void onDraw(Color)

    4. public void onDraw(Canvas)

    Answer
  • 20.

    When publishing an update to your application to the market, the following must be taken into consideration:

    1. The package name must be the same and the .apk must be signed with the same private key.

    2. The package name must be the same, but the .apk may be signed with a different private key.

    3. The package name does not have to be the same and the .apk can be signed with a different private key.

    4. The package name does not have to be the same, but the .apk must be signed with the same private key.

    Answer

© 2017 QuizBucket.org