Premium

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



Question : What does the Android project folder "res/" contain?

 : What does the Android project folder
1. Java Activity classes

2. Resource files

3. Java source code

4. Libraries

Correct Answer : 2
Explanation: In the /res folder you can have:

anim/ - XML files that define tween animations

color/ - XML files that define a state list of colors.

drawable/ - Bitmap files / Nine-Patches (re-sizable bitmaps) / State lists / Shapes / Animation drawables / Other drawables

layout/ - XML files that define a user interface layout.

menu/ - XML files that define application menus, such as an Options Menu, Context Menu, or Sub Menu.

raw/ - Arbitrary files to save in their raw form.

values/ - XML files that contain simple values, such as strings, integers, and colors.

arrays.xml for resource arrays (typed arrays).
colors.xml for color values
dimens.xml for dimension values.
strings.xml for string values.
styles.xml for styles.
xml/ - Arbitrary XML files




Question : What does this code do?

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(android.net.Uri.parse("http://www.androidatc.com"));
startActivity(intent);

 : What does this code do?
1. Starts a sub-activity

2. Starts a service

3. Sends results to another activity.

4. Starts an activity using an implicit intent.

Correct Answer : 4
Explanation: Intents are asynchronous messages which allow application components to request functionality from other Android components. Intents allow you to interact with components from the same applications as well as with components contributed by other applications. For example, an activity can start an external activity for taking a picture.

Intents are objects of the android.content.Intent type. Your code can send them to the Android system defining the components you are targeting. For example, via the startActivity() method you can define that the intent should be used to start an activity. An intent can contain data via a Bundle. This data can be used by the receiving component. Different types of intents Android supports explicit and implicit intents. An application can define the target component directly in the intent (explicit intent) or ask the Android system to evaluate registered components based on the intent data (implicit intents). Explicit Intents : Explicit intents explicitly define the component which should be called by the Android system, by using the Java class as identifier. The following shows how to create an explicit intent and send it to the Android system. If the class specified in the intent represents an activity, the Android system starts it.

Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
Explicit intents are typically used within on application as the classes in an application are controlled by the application developer.
Implicit Intents : Implicit intents specify the action which should be performed and optionally data which provides content for the action. For example, the following tells the Android system to view a webpage. All installed web browsers should be registered to the corresponding intent data via an intent filter.

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.hadoopexam.com"));
startActivity(i);
If an implicit intent is sent to the Android system, it searches for all components which are registered for the specific action and the fitting data type. If only one component is found, Android starts this component directly. If several components are identified by the Android system, the user will get a selection dialog and can decide which component should be used for the intent.

A component can register itself for actions. Data transfer to the target component
An intent contains certain header data, e.g., the desired action, the type, etc. Optionally an intent can also contain additional data based on an instance of the Bundle class which can be retrieved from the intent via the getExtras() method. You can also add data directly to the Bundle via the overloaded putExtra() methods of the Intent objects. Extras are key/value pairs. The key is always of type String. As value you can use the primitive data types (int, float, ...) plus objects of type String, Bundle, Parceable and Serializable.

The receiving component can access this information via the getAction() and getData() methods on the Intent object. This Intent object can be retrieved via the getIntent() method.The component which receives the intent can use the getIntent().getExtras() method call to get the extra data. That is demonstrated in the following code snippet.






Question : Which of the following is a Java call-back method invoked when a view is clicked?

 : Which of the following is a Java call-back method invoked when a view is clicked?
1. Detector

2. OnTapListener

3. OnClickDetector

4. OnClickListener

Correct Answer : 4
Explanation: You may use OnClickListener when you want your compoments to react when users click on them. Most (if not all) of the GUI Android components can be bundled with an OnClickListener, so you can see that its a very important component.


Related Questions


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.


Question : What does the following code achieve?

Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
startActivityForResult(intent);

 : What does the following code achieve?
1. Starts a browser activity

2. Starts a sub-activity

3. Starts an activity service

4. Sends results to another activity.


Question : When using an implicit intent, what process does the system use to know what to do with it?

 : When using an implicit intent, what process does the system use to know what to do with it?
1. Intent resolution

2. Intent declaration

3. Intent overloading

4. Intent transition


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

 : Which of the following is NOT true about the MenuItem interface?
1. The MenuItem instance will be returned by the Menu class add(...) method.

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

3. MenuItem can display either an icon or text.

4. MenuItem can set a checkbox