Android App Development Test - 2

Android App Development Test-2

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Android 2.3 introduced a new developer tool called __________. This tool detects disk or network operations occurring on the main thread and takes action to warn the developer.

  1. SMode
  2. StrictMode
  3. DetectMode
  4. DetectAll()
Question 2 Multiple Choice (Single Answer)

What is the purpose of Handler class in android?

  1. This allows us to send message to be processed immediately only.
  2. This allows us to send messages can be processed at some time in the future only.
  3. This allows us to send messages which can be processed immediately or scheduled for processing at some time in the future.
  4. None of the above
Question 3 Multiple Choice (Single Answer)

The _________ class creates and manages a MessageQueue object that holds all messages for a thread.

  1. loader
  2. looper
  3. handler
  4. load
Question 4 Multiple Choice (Single Answer)

The looper class creates and manages a______________ object that holds all messages for a thread.

  1. QueueMessage
  2. Handler
  3. MessageThread
  4. MessageQueue
Question 5 Multiple Choice (Single Answer)

Which of the following is not a valid screen pixel density?

  1. ldpi
  2. mdpi
  3. hdpi
  4. xdpi
Question 6 Multiple Choice (Single Answer)

Which of the following is the correct way to declare StrictMode that detects all types of networks and disk I/O?

  1. ```java
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDialog()
    .build());
  2. ```java
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDeath()
    .build());
  3. ```java
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyLog()
    .penaltyDialog()
    );
  4. ```java
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
    .detectAll()
    .penaltyDialog()
    .build());
Question 7 Multiple Choice (Single Answer)

How can we create a method that checks for messages in the message queue?

  1. ```java
    Public Boolean isTimerRunn(){
    Return mHandler.hasMessages(0);
    }
  2. ```java
    Private Boolean isTimerRunn(){
    Return mHandler.hasMessages(0);
    }
  3. ```java
    Private Boolean is TimerRunn(){
    Return mHandler.hasMessages(0);
    }
  4. ```java
    Private Boolean isTimerRunn(){
    Return mHandler.queueMessages(0);
    }
Question 8 Multiple Choice (Single Answer)

In contrast to ________, android doesn’t know the size, screen resolution or aspect ratio of the devices they run on.

  1. Android devices
  2. IOS devices
  3. Blackberry devices
  4. Microsoft
Question 9 Multiple Choice (Single Answer)

How many types of screen sizes are there in the configuration option of android?

  1. Small, normal, and large
  2. Small, normal, large, and xlarge
  3. Small, medium,and large
  4. Small, medium, large, and xlarge
Question 10 Multiple Choice (Single Answer)

Which of the following is not a Android dimension units?

  1. mm
  2. pt
  3. dip
  4. cp
Question 11 Multiple Choice (Single Answer)

Which of the following statement is/are correct?
A. dip is an abstract unit representing a single pixel on a device with a resolution of 160 dpi.
B. pt unit are the 1/75 of the physical screen size.

  1. Only A
  2. Only B
  3. Both A and B
  4. Neither A nor B
Question 12 Multiple Choice (Single Answer)

Which of the following classes can be extended to create a simple thread to perform background tasks and publish the results on the UI thread?

  1. Async
  2. AsyncBackgroundTask
  3. AsyncTask
  4. SyncTask
Question 13 Multiple Choice (Single Answer)

Which of the following codes will record the current system time and send a message to the handler starting the timer and remove any existing message before sending the next one?

  1. ```java
    Private void startTimer(){
    mSt=System.currentTimeMillis();
    mHandler.removeMessages(0);
    mHandler.sendEmptyMessage(0);
    }
  2. ```java
    Private void startTimer(){
    mSt=System.currentTime();
    mHandler.removeMessages(0);
    mHandler.sendEmptyMessage(0);
    }
  3. ```java
    Private void startTimer(){
    mSt=System.currentTimeMillis();
    mHandler.removeMessage(0);
    mHandler.sendEmptyMessage(0);
    }
  4. ```java
    Private void startTimer(){
    mSt=System.currentTimeMillis();
    mHandler.removeMessages(0);
    mHandler.sendEmptyMessages(0);
    }
Question 14 Multiple Choice (Single Answer)

Which of the following classes is useful in a situation like downloading new posts from Twitter and then loading those posts into a timeline?

  1. AsyncTask
  2. Loader
  3. Handler
  4. MessageQueue
Question 15 Multiple Choice (Single Answer)

List the point which makes your app compatible with majority of the devices:
A. Always use dip unit in your layout.
B. Use wrap_content and match_parent whenever possible.
C. Provide alternative image resources for each density .
D. Use 9-patch graphics for any resources.
E. Always use sp unit in your layout.

  1. B, C, D, E
  2. A, B, C, E
  3. A, B, C, D
  4. A, C, D, E