Premium

Associate Android Developer Certification Questions and Answer (Dumps and Practice Questions)



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

 : 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 need to add permission "android.permission.ACCESS_NETWORK_STATE"

3. Access Mostly Uused Products by 50000+ Subscribers

4. You use loadData to load HTML

Correct Answer : Get Lastest Questions and Answer :
Explanation:




Question : Which of the following is NOT true about class AsyncTask?

 : Which of the following is NOT true about class AsyncTask?
1. It must be used by sub-classing it.

2. It must be created on the UI thread.

3. Access Mostly Uused Products by 50000+ Subscribers

4. It uses three generic types.

Correct Answer : Get Lastest Questions and Answer :
Explanation: AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.

AsyncTask is designed to be a helper class around Thread and Handler and does not constitute a generic threading framework. AsyncTasks should ideally be used for short operations (a few seconds at the most.) If you need to keep threads running for long periods of time, it is highly recommended you use the various APIs provided by the java.util.concurrent package such as Executor, ThreadPoolExecutor and FutureTask.

An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.




Question : What does the following line of code do?
Toast toast = Toast.makeText(this,"Android ATC", Toast.LENGTH_LONG);
toast.setGravity(Gravity.TOP|Gravity.RIGH, 0, 0);

 : What does the following line of code do?
1. The toast will have it UI components place on the top-right corner.

2. The toast will appear on the top-right corner.

3. Access Mostly Uused Products by 50000+ Subscribers

4. The toast will appear at the center of the screen at position (0,0), but aligned to the top-right corner.

Correct Answer : Get Lastest Questions and Answer :
Explanation: A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. For example, navigating away from an email before you send it triggers a "Draft saved" toast to let you know that you can continue editing later. Toasts automatically disappear after a timeout.
Positioning your Toast
A standard toast notification appears near the bottom of the screen, centered horizontally. You can change this position with the setGravity(int, int, int) method. This accepts three parameters: a Gravity constant, an x-position offset, and a y-position offset.

For example, if you decide that the toast should appear in the top-left corner, you can set the gravity like this:

toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);
If you want to nudge the position to the right, increase the value of the second parameter. To nudge it down, increase the value of the last parameter.


Related Questions


Question : An AsyncTask can be cancelled anytime from any thread.

 : An AsyncTask can be cancelled anytime from any thread.
1. True
2. False


Question : Which of the following is NOT true about onMeasure() method of class View?

 : Which of the following is NOT true about onMeasure() method of class View?
1. It measures the view and its contents to determine the measured width and height.

2. It is invoked by measure().

3. When overriding this method, a developer must call setMeasuredDimension().

4. It takes three parameters: the height, width, and the depth of the view.


Question : Which of the following Activity life-cycle methods is invoked when a dialog is shown?

 : Which of the following Activity life-cycle methods is invoked when a dialog is shown?
1. onPause()

2. onCreate()

3. onStop()

4. onDestroy()


Question : Which of the following is NOT true about class DefaultHttpClient?

 : Which of the following is NOT true about class DefaultHttpClient?
1. It supports HTTPS.

2. It supports streaming uploads and downloads.

3. It is only supported on Android versions 2.2 and older.

4. It is Andriod's default implementation of an HTTP client.


Question : Which of the following is NOT true about the SharedPreferences interface?

 : Which of the following is NOT true about the SharedPreferences interface?
1. The data it saves is persistent even if application is killed.

2. It only saves primitive data in key-value pairs.

3. Modifications to preferences saved should go through class SharedPreferences.Editor

4. It can save any data type in key-value pairs


Question : What does the following code do?

dialog.getWindow().setFlags(LayoutParams.FLAG_BLUR_BEHIND, LayoutParams.FLAG_BLUR_BEHIND);

 : What does the following code do?
1. When dialog is displayed the activity behind it will be blurred.

2. When dialog is displayed the activity behind it will be dimmed.

3. Any EditText behind the dialog will be disabled.

4. When the dialog is displayed, the edges of the dialog will be blurred.