Premium

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



Question : Which of these is the correct method to persist SharedPreferences?

 : Which of these is the correct method to persist SharedPreferences?
1. XML file

2. SQLite

3. Access Mostly Uused Products by 50000+ Subscribers

4. Java object

Correct Answer : Get Lastest Questions and Answer :
Explanation: Although you can instantiate new Preference objects at runtime, you should define your list of settings in XML with a hierarchy of Preference objects. Using an XML file to define your collection of settings is preferred because the file provides an easy-to-read structure that's simple to update. Also, your app's settings are generally pre-determined, although you can still modify the collection at runtime.

Each Preference subclass can be declared with an XML element that matches the class name, such as .

You must save the XML file in the res/xml/ directory. Although you can name the file anything you want, it's traditionally named preferences.xml. You usually need only one file, because branches in the hierarchy (that open their own list of settings) are declared using nested instances of PreferenceScreen.

Note: If you want to create a multi-pane layout for your settings, then you need separate XML files for each fragment.

The root node for the XML file must be a element. Within this element is where you add each Preference. Each child you add within the element appears as a single item in the list of settings.




Question : Which of these is the incorrect explanation of the Java Native Interface(JNI)?

 : Which of these is the incorrect explanation of the Java Native Interface(JNI)?
1. JNI does not provide garbage collection on the native side, outside the memory resources of
the Java Virtual Machine.

2. Even if native code is used with JNI, it does not necessarily mean an improvement in the
application processing speed.

3. Access Mostly Uused Products by 50000+ Subscribers
side.

4. Header files generated on the Java side are included and implemented in the native (C/C++)
side source code.

Correct Answer : Get Lastest Questions and Answer :
Explanation: JNI is the Java Native Interface. It defines a way for managed code (written in the Java programming language) to interact with native code (written in C/C++). It's vendor-neutral, has support for loading code from dynamic shared libraries, and while cumbersome at times is reasonably efficient.
JNI defines two key data structures, "JavaVM" and "JNIEnv". Both of these are essentially pointers to pointers to function tables. (In the C++ version, they're classes with a pointer to a function table and a member function for each JNI function that indirects through the table.) The JavaVM provides the "invocation interface" functions, which allow you to create and destroy a JavaVM. In theory you can have multiple JavaVMs per process, but Android only allows one.

The JNIEnv provides most of the JNI functions. Your native functions all receive a JNIEnv as the first argument.

The JNIEnv is used for thread-local storage. For this reason, you cannot share a JNIEnv between threads. If a piece of code has no other way to get its JNIEnv, you should share the JavaVM, and use GetEnv to discover the thread's JNIEnv. (Assuming it has one; see AttachCurrentThread below.)

The C declarations of JNIEnv and JavaVM are different from the C++ declarations. The "jni.h" include file provides different typedefs depending on whether it's included into C or C++. For this reason it's a bad idea to include JNIEnv arguments in header files included by both languages. (Put another way: if your header file requires #ifdef __cplusplus, you may have to do some extra work if anything in that header refers to JNIEnv.)

The Microsoft Java VM supports two native method interfaces. At the low level, it provides an efficient Raw Native Interface (RNI). The RNI offers a high degree of source-level backward compatibility with the JDK's native method interface, although it has one major difference. Instead of relying on conservative garbage collection, the native code must use RNI functions to interact explicitly with the garbage collector.

At a higher level, Microsoft's Java/COM interface offers a language-independent standard binary interface to the Java VM. Java code can use a COM object as if it were a Java object. A Java class can also be exposed to the rest of the system as a COM class.






Question : Which is the correct explanation of ListView?
A. It is necessary to use ListView as a set with ListActivity.
B. There is a function in ListView which displays a message when there is no information to be displayed.
C. When displaying an array using an Adapter class in ListView, it is necessary to convert it into a Collection class.
D. ListView has a function to display a list of uniquely defined Views other than TextView.

 : Which is the correct explanation of ListView?
1. It is necessary to use ListView as a set with ListActivity.

2. There is a function in ListView which displays a message when there is no information to be displayed.

3. Access Mostly Uused Products by 50000+ Subscribers

4. ListView has a function to display a list of uniquely defined Views other than TextView.


Correct Answer : Get Lastest Questions and Answer :
Explanation: ListView is a view group that displays a list of scrollable items. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.

Android provides the ListView and the ExpandableListView classes which is capable of displaying a scrollable list of items. The ExpandableListView class supports a grouping of items.

The input to the list (items in the list) can be arbitrary Java objects. The adapter extracts the correct data from the data object and assigns this data to the views in the row of the ListView.

These items are typically called the data model of the list. An adapter can receive data as input.
An adapter manages the data model and adapts it to the individual entries in the widget. An adapter extends the BaseAdapter class.

Every line in the widget displaying the data consists of a layout which can be as complex as you want.





Related Questions


Question : Which of these is the incorrect explanation of the androiddebuggable attribute of the
AndroidManifest.xm tag?

 : Which of these is the incorrect explanation of the androiddebuggable attribute of the
1. If not set, it will be handled as "false".

2. It is necessary to set this to "true" in order to use Eclipse's breakpoint function.

3. Access Mostly Uused Products by 50000+ Subscribers

4. When releasing the application, deleting android:debuggable is recommended.


Question : Which of these is the correct description of file access?


 : Which of these is the correct description of file access?
1. Generally, files are handled as dedicated resources per each application.

2. Files created by an application can be directly accessed by any application.

3. Access Mostly Uused Products by 50000+ Subscribers

4. In order to access a file, the open FileStream method is provided in the Context class



Question : Which of these is the correct method to persist SharedPreferences?

 : Which of these is the correct method to persist SharedPreferences?
1. XML file

2. SQLite

3. Access Mostly Uused Products by 50000+ Subscribers

4. Java object


Question : Which of these is the incorrect explanation of the Java Native Interface(JNI)?

 : Which of these is the incorrect explanation of the Java Native Interface(JNI)?
1. JNI does not provide garbage collection on the native side, outside the memory resources of the Java Virtual Machine.

2. Even if native code is used with JNI, it does not necessarily mean an improvement in the application processing speed.

3. Access Mostly Uused Products by 50000+ Subscribers

4. Header files generated on the Java side are included and implemented in the native (C/C++) side source code.


Question : The following code is a part of an Activity class to create a dialog. Which is the Activity class method used to display this dialog?

01 : @Override
02 : protected Dialog onCreateDialog(int id) {
03 : return new AlertDialog.Builder(this).setMessage("message").create();
04: }


 : The following code is a part of an Activity class to create a dialog. Which is the Activity class method used to display this dialog?
1. void createDialog();

2. void createDialogfint id);

3. Access Mostly Uused Products by 50000+ Subscribers

4. void showDialog(int id);


Question : Which of these is the correct method to persist SharedPreferences?

 : Which of these is the correct method to persist SharedPreferences?
1. XML file

2. SQLite

3. Access Mostly Uused Products by 50000+ Subscribers

4. Java object