Free AND-401 Exam Braindumps (page: 16)

Page 15 of 58

Which of following is incorrect about the Toast class?

  1. You cannot set a custom layout for a Toast.
  2. A Toast can only be created by an Activity class
  3. There is no need to close or hide a Toast, since it closes automatically.
  4. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT or Toast.LENGTH_LONG

Answer(s): B

Explanation:

An Android Toast is a small message displayed on the screen, similar to a tool tip or other similar popup notification. A Toast is displayed on top of the main content of an activity, and only remains visible for a short time period.


Reference:

http://tutorials.jenkov.com/android/toast.html



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

  1. The contacts list
  2. The telephone log
  3. The bookmarks
  4. The application list

Answer(s): D

Explanation:

Incorrect:
A: You usually need the MIME type when you are working with a provider that contains complex data structures or files. For example, the ContactsContract.Data table in the Contacts Provider uses MIME types to label the type of contact data stored in each row.
C: The Browser's Bookmark and History content provider URI is in: android.provider.Browser.BOOKMARKS_URI


Reference:

http://developer.android.com/guide/topics/providers/content-provider-basics.html http://jcla1.com/blog/using-content-providers-in-android/



When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?

  1. /data/app/<package name>/files
  2. /data/data/<package name>/files
  3. /system/app/<package name>/files
  4. /system/data/<package name>/files

Answer(s): B

Explanation:

The file is created in the /data/data/PACKAGE_NAME/files folder.


Reference:

http://www.programcreek.com/java-api-examples/index.php?class=android.content.Context&method=openFileOutput



Which of the following is incorrect about the LogCat tool?

  1. LogCat UI tool is available inside Android Studio.
  2. You can create a log in your application using Log.v(String, String)
  3. Each log message has a tag
  4. Only one of your applications can create log entries, and it should be component class (Activity,Service,...etc)

Answer(s): D






Post your Comments and Discuss Android AND-401 exam with other Community members:

AND-401 Exam Discussions & Posts